String authcode = extractAuthorizationToken(request);
oAuthHandler.setAuthorization_code(authcode);
try {
oAuthHandler.getAccessTokenForAuthorizedUser(); // This retrieves and sets all authentication information in OAuth2Handler
AccessToken token = oAuthHandler.createToken(oAuthHandler.getAppId(),oAuthHandler.getServiceName());
// Store the new key
oAuthHandler.setAccessTokenObject(token);
if(!context.isCurrentUserAnonymous()) {
CredentialStore credStore = CredentialStoreFactory.getCredentialStore(oAuthHandler.getCredentialStore());
if(credStore!=null) {