Class OpenIDConnect


  • public class OpenIDConnect
    extends java.lang.Object
    Class for providing Open ID Connect (OIDC) services.
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenIDConnect()  
    • Method Summary

      Modifier and Type Method Description
      static java.lang.String buildAuthorizationURL​(javax.servlet.http.HttpServletResponse response, java.lang.String debug, java.lang.String su)
      Returns the authorization URL for authenticating a user.
      static java.lang.String getCookieValue​(javax.servlet.http.HttpServletRequest request, java.lang.String name)
      Returns the cookie value for the cookie with the matching name.
      static TokenData getTokenData​(java.lang.String authorizationCode)
      Returns the token data derived from the authorization code.
      static IdToken validateIDToken​(java.lang.String token, java.lang.String nonce)
      Returns the id token data from the validated token.
      • Methods inherited from class java.lang.Object

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

      • OpenIDConnect

        public OpenIDConnect()
    • Method Detail

      • getCookieValue

        public static java.lang.String getCookieValue​(javax.servlet.http.HttpServletRequest request,
                                                      java.lang.String name)
        Returns the cookie value for the cookie with the matching name.
        Parameters:
        request - the http servlet request
        name - the cookie name
        Returns:
        the cookie value
      • buildAuthorizationURL

        public static java.lang.String buildAuthorizationURL​(javax.servlet.http.HttpServletResponse response,
                                                             java.lang.String debug,
                                                             java.lang.String su)
        Returns the authorization URL for authenticating a user. Also stores the state and nonce values in cookies to be used later in validation.
        Parameters:
        response - the http servlet response
        debug - set to "true" if debug information is to be output instead of authenticating the user
        su - if provided and the authenticated user is an admin, this is the user id they will assume
        Returns:
        the authorization URL
      • getTokenData

        public static TokenData getTokenData​(java.lang.String authorizationCode)
        Returns the token data derived from the authorization code.
        Parameters:
        authorizationCode - the authorization code
        Returns:
        the token data
      • validateIDToken

        public static IdToken validateIDToken​(java.lang.String token,
                                              java.lang.String nonce)
        Returns the id token data from the validated token.
        Parameters:
        token - the token
        nonce - the nonce
        Returns:
        the validated id token data