Skip to content

Instantly share code, notes, and snippets.

@paulryan
Created November 20, 2016 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paulryan/f7bda1a15e6f39039a8ca5ab24bb923d to your computer and use it in GitHub Desktop.
Save paulryan/f7bda1a15e6f39039a8ca5ab24bb923d to your computer and use it in GitHub Desktop.
Usage of OAuth implict flow lib
var aadAppClientId = "8BE5AA0E-F900-4BDF-A7CF-71B3CC53B78E";
var resource = "https://graph.microsoft.com"
var query = "/v1.0/me/events";
var tokenFactory = new CC.CORE.Adal.AppTokenFactory(aadAppClientId, resource);
tokenFactory.ExecuteQuery(query)
.done(function (response) {
// Success!
})
.fail(function (response) {
// NOTE: Provide a link to renew an expired or yet to be approved session:
// "Sorry, your session has expired or requires your approval.
// <div><a href='" + response.authorizeUrl + "'>Click here to sign in</a></div>";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment