Skip to content

Instantly share code, notes, and snippets.

@phillipharding
Forked from paulryan/implicitflow_usage.js
Created June 20, 2017 13:12
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 phillipharding/cdd5cf9c1ab287a6b6bb9aeb77de9368 to your computer and use it in GitHub Desktop.
Save phillipharding/cdd5cf9c1ab287a6b6bb9aeb77de9368 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