Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Response Code 2001 (BROWSER_CODE_CANCEL) when trying to call authentication Users via Azure AD

$
0
0

Hi all,

I got an error code: 2001  (BROWSER_CODE_CANCEL)  when i'm trying to use following code

    mAuthContext= new AuthenticationContext(Login.this, Constants.AUTHORITY_URL,
false, InMemoryCacheStore.getInstance());

mAuthContext.acquireToken(Login.this, Constants.RESOURCE_ID, Constants.CLIENT_ID,
Constants.REDIRECT_URL, Constants.USER_HINT, PromptBehavior.Auto, Constants.EXTRA_QP,
new AuthenticationCallback<AuthenticationResult>() {

private static final String TAG = "LoginActivity";

@Override
public void onError(Exception ex) {
if (ex instanceof AuthenticationException) {
Log.d(TAG, ex.getMessage());
} else {

Log.d(TAG, "Authentication error:" + ex.getMessage());
}
}

@Override
public void onSuccess(AuthenticationResult result) {
if (result == null || result.getAccessToken() == null
|| result.getAccessToken().isEmpty()) {

Log.d(TAG, "Token is empty");
} else {
// request is successful
Log.d(TAG, "Status:" + result.getStatus() + " Expired:"
+ result.getExpiresOn().toString());
}
}
}
);
}

who can help me?

Thanks a lot.



Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>