Package ca.ubc.ece.flowable.oidc
Class OpenIDConnect
- java.lang.Object
-
- ca.ubc.ece.flowable.oidc.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.
-
-
-
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 requestname
- 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 responsedebug
- set to "true" if debug information is to be output instead of authenticating the usersu
- 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 tokennonce
- the nonce- Returns:
- the validated id token data
-
-