Skip to content

Instantly share code, notes, and snippets.

@westonkd
Created April 29, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonkd/1fa5c4f9c174e66398ba9cc8a9bd9eb5 to your computer and use it in GitHub Desktop.
Save westonkd/1fa5c4f9c174e66398ba9cc8a9bd9eb5 to your computer and use it in GitHub Desktop.
OAuth 2 #canvas_reference
function success(response) {
console.log(response)
}
$.ajax({
type: "POST",
url: '/login/oauth2/token',
data: {
grant_type: 'authorization_code',
client_id: '10000000000048',
client_secret: 'gOFeXyE8k8nJvDGh58rb9l14hem0j9kAZirmrOwEZMobndjaNDJekIzMsRvflanU',
redirect_uri: 'https://httpbin.org/post',
code: '5638dc2e13c7741e87199ac0cd86e0e644e29f76ecca99299dc33f1ede616dc537b38cb9f35add98481b49fffd91bb801cd8dc75e562b9db72e0426519913631',
scope: 'url:GET|/api/v1/announcements'
},
success: success,
fail: function(response) { console.log(response) }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment