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.