use of org.gatein.security.oauth.google.GoogleProcessor in project gatein-portal by Meeds-io.
the class GoogleFilter method getOAuthPrincipal.
@Override
protected OAuthPrincipal<GoogleAccessTokenContext> getOAuthPrincipal(HttpServletRequest request, HttpServletResponse response, InteractionState<GoogleAccessTokenContext> interactionState) {
GoogleAccessTokenContext accessTokenContext = interactionState.getAccessTokenContext();
Userinfo userInfo = ((GoogleProcessor) getOauthProviderProcessor()).obtainUserInfo(accessTokenContext);
if (log.isTraceEnabled()) {
log.trace("Obtained tokenResponse from Google authentication: " + accessTokenContext);
log.trace("User info from Google: " + userInfo);
}
OAuthPrincipal<GoogleAccessTokenContext> oauthPrincipal = OAuthUtils.convertGoogleInfoToOAuthPrincipal(userInfo, accessTokenContext, getOAuthProvider());
return oauthPrincipal;
}
Aggregations