Class CookieOAuth2AuthenticationMechanism

  • All Implemented Interfaces:
    AuthenticationMechanism

    public class CookieOAuth2AuthenticationMechanism
    extends java.lang.Object
    implements AuthenticationMechanism
    A way to authenticate HTTP requests using OAuth2 ID tokens stored in cookies.

    This is generic to Google Single-Sign-On and doesn't have any ties with Google App Engine.

    • Constructor Summary

      Constructors 
      Constructor Description
      CookieOAuth2AuthenticationMechanism​(com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier googleIdTokenVerifier)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AuthResult authenticate​(javax.servlet.http.HttpServletRequest request)
      Attempt to authenticate an incoming request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CookieOAuth2AuthenticationMechanism

        @Inject
        public CookieOAuth2AuthenticationMechanism​(com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier googleIdTokenVerifier)
    • Method Detail

      • authenticate

        public AuthResult authenticate​(javax.servlet.http.HttpServletRequest request)
        Description copied from interface: AuthenticationMechanism
        Attempt to authenticate an incoming request.
        Specified by:
        authenticate in interface AuthenticationMechanism
        Parameters:
        request - the request to be authenticated
        Returns:
        the results of the authentication check; if the request could not be authenticated, the mechanism should return AuthResult.NOT_AUTHENTICATED