Search in sources :

Example 1 with GoogleProcessor

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;
}
Also used : Userinfo(com.google.api.services.oauth2.model.Userinfo) GoogleAccessTokenContext(org.gatein.security.oauth.google.GoogleAccessTokenContext) GoogleProcessor(org.gatein.security.oauth.google.GoogleProcessor)

Aggregations

Userinfo (com.google.api.services.oauth2.model.Userinfo)1 GoogleAccessTokenContext (org.gatein.security.oauth.google.GoogleAccessTokenContext)1 GoogleProcessor (org.gatein.security.oauth.google.GoogleProcessor)1