Package io.asgardeo.java.oidc.sdk
Class DefaultOIDCManager
- java.lang.Object
-
- io.asgardeo.java.oidc.sdk.DefaultOIDCManager
-
- All Implemented Interfaces:
OIDCManager
public class DefaultOIDCManager extends Object implements OIDCManager
OIDC manager implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultOIDCManager(OIDCAgentConfig oidcAgentConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionContexthandleOIDCCallback(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RequestContext requestContext)Processes the OIDC callback response and extract the authorization code, builds a token request, sends the token request and parse the token response where the authenticated user info and tokens would be added to theSessionContextobject and returned.RequestContextlogout(SessionContext sessionContext, javax.servlet.http.HttpServletResponse response)Builds a logout request and redirects.RequestContextsendForLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Builds an authentication request and redirects.
-
-
-
Constructor Detail
-
DefaultOIDCManager
public DefaultOIDCManager(OIDCAgentConfig oidcAgentConfig) throws SSOAgentClientException
- Throws:
SSOAgentClientException
-
-
Method Detail
-
sendForLogin
public RequestContext sendForLogin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SSOAgentException
Builds an authentication request and redirects.- Specified by:
sendForLoginin interfaceOIDCManager- Parameters:
request- IncomingHttpServletRequest.response- OutgoingHttpServletResponse- Returns:
RequestContextObject containing details regarding the state ID, nonce value for theAuthenticationRequest.- Throws:
SSOAgentException
-
handleOIDCCallback
public SessionContext handleOIDCCallback(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RequestContext requestContext) throws SSOAgentException
Processes the OIDC callback response and extract the authorization code, builds a token request, sends the token request and parse the token response where the authenticated user info and tokens would be added to theSessionContextobject and returned.- Specified by:
handleOIDCCallbackin interfaceOIDCManager- Parameters:
request- IncomingHttpServletRequest.response- OutgoingHttpServletResponse.requestContext-RequestContextobject containing the authentication request related information.- Returns:
SessionContextObject containing the authenticatedUser, AccessToken, RefreshToken and IDToken.- Throws:
SSOAgentException- Upon failed authentication.
-
logout
public RequestContext logout(SessionContext sessionContext, javax.servlet.http.HttpServletResponse response) throws SSOAgentException
Builds a logout request and redirects.- Specified by:
logoutin interfaceOIDCManager- Parameters:
sessionContext-SessionContextof the logged in session.response- OutgoingHttpServletResponse- Returns:
RequestContextObject containing details regarding the state ID and other parameters of theLogoutRequest.- Throws:
SSOAgentException
-
-