Class OpenIDAuthenticationManager

    • Constructor Detail

      • OpenIDAuthenticationManager

        public OpenIDAuthenticationManager()
    • Method Detail

      • doExternalAuthentication

        public AuthenticatedUser doExternalAuthentication​(javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
        Description copied from class: ExternalAuthenticationManager
        To be implemented with the logic of the external authentication
        Specified by:
        doExternalAuthentication in class ExternalAuthenticationManager
        Parameters:
        request - HTTP request object to handle parameters and session attributes
        response - HTTP response object to handle possible redirects
        Returns:
        the information of the successfully authenticated user
      • doLogout

        protected void doLogout​(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws javax.servlet.ServletException,
                                IOException
        Description copied from class: AuthenticationManager
        Method called from the logout method after clearing all session attributes. The usual process is to redirect the user to the login page
        Specified by:
        doLogout in class AuthenticationManager
        Parameters:
        request - HTTP request object
        response - HTTP response object
        Throws:
        javax.servlet.ServletException
        IOException
      • getUser

        protected AuthenticatedUser getUser​(String responseData,
                                            OAuth2AuthenticationProvider configuration)
                                     throws org.codehaus.jettison.json.JSONException,
                                            OAuth2TokenVerificationException
        Retrieves the ID of the authenticated User. By default this method assumes that the provided response data contains an OpenID token which includes an email which is used to find the authenticated user.
        Parameters:
        responseData - The data obtained in the response of the access token request
        configuration - the OAuth 2.0 configuration with information that can be used to verify the token like the URL to get the public keys required by the algorithm used for encrypting the token data.
        Returns:
        the AuthenticatedUser with the information of the authenticated User
        Throws:
        org.codehaus.jettison.json.JSONException - If it is not possible to parse the response data as JSON or if the "id_token" property is not present in the response
        OAuth2TokenVerificationException - If it is not possible to verify the token or extract the authentication data
        AuthenticationException - If there is no user linked to the retrieved email