Created
May 8, 2017 13:25
-
-
Save mehdok/380f1c44069ad8248bd0eecb1d889d48 to your computer and use it in GitHub Desktop.
Authentication with microsoft ADAL v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getAuthenticationContext().acquireToken( | |
mContextActivity, | |
Constants.SCOPES.split(" "), | |
null, | |
Constants.CLIENT_ID, | |
Constants.REDIRECT_URI, | |
PromptBehavior.Auto, | |
new AuthenticationCallback<AuthenticationResult>() { | |
@Override | |
public void onSuccess(final AuthenticationResult authenticationResult) { | |
if (authenticationResult != null && | |
authenticationResult.getStatus() == | |
AuthenticationResult.AuthenticationStatus.Succeeded) { | |
dependencyResolver = new DefaultDependencyResolver(authenticationResult.getToken()); | |
discoverServices(); | |
} | |
} | |
@Override | |
public void onError(Exception t) { | |
Log.e("onError", "onError : " + t.getMessage()); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment