Package org.pac4j.core.client
Class IndirectClient
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.client.BaseClient
org.pac4j.core.client.IndirectClient
- All Implemented Interfaces:
Client
Indirect client: the requested protected URL is saved, the user is redirected to the identity provider for login and
back to the application after the sucessful authentication and finally to the originally requested URL.
- Since:
- 1.9.0
- Author:
- Jerome Leleu
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantATTEMPTED_AUTHENTICATION_SUFFIX="$attemptedAuthentication"
protected String
protected CallbackUrlResolver
protected UrlResolver
Fields inherited from class org.pac4j.core.client.BaseClient
logger, saveProfileInSession
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
afterInternalInit
(boolean forceReinit) afterInternalInit.protected void
beforeInternalInit
(boolean forceReinit) beforeInternalInit.protected void
checkCredentials
(CallContext ctx, Credentials credentials) Check the credentials.computeFinalCallbackUrl
(WebContext context) computeFinalCallbackUrl.getCodeVerifierSessionAttributeName.final Optional<RedirectionAction>
getLogoutAction
(CallContext ctx, UserProfile currentProfile, String targetUrl) Return the logout action (indirect clients).getNonceSessionAttributeName.final Optional<RedirectionAction>
Return the redirection action to the authentication provider (indirect clients).getStateSessionAttributeName.protected CallbackUrlResolver
newDefaultCallbackUrlResolver.processLogout
(CallContext ctx, Credentials credentials) Process the logout.protected void
setLogoutActionBuilderIfUndefined
(LogoutActionBuilder logoutActionBuilder) setLogoutActionBuilderIfUndefined.protected void
setLogoutProcessorIfUndefined
(LogoutProcessor logoutProcessor) setLogoutProcessorIfUndefined.protected void
setRedirectionActionBuilderIfUndefined
(RedirectionActionBuilder redirectActionBuilder) setRedirectionActionBuilderIfUndefined.Methods inherited from class org.pac4j.core.client.BaseClient
addAuthorizationGenerator, addAuthorizationGenerators, findSessionLogoutHandler, getCredentials, getName, getSaveProfileInSession, getUserProfile, internalValidateCredentials, isMultiProfile, notifySessionRenewal, renewUserProfile, setAuthenticatorIfUndefined, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractorIfUndefined, setCustomProperties, setProfileCreatorIfUndefined, setProfileFactoryWhenNotAuthenticated, validateCredentials
Methods inherited from class org.pac4j.core.util.InitializableObject
getNbAttempts, init, init, internalInit, isInitialized, reinit, shouldInitialize
-
Field Details
-
ATTEMPTED_AUTHENTICATION_SUFFIX
ConstantATTEMPTED_AUTHENTICATION_SUFFIX="$attemptedAuthentication"
- See Also:
-
callbackUrl
-
urlResolver
-
callbackUrlResolver
-
-
Constructor Details
-
IndirectClient
public IndirectClient()
-
-
Method Details
-
beforeInternalInit
protected void beforeInternalInit(boolean forceReinit) beforeInternalInit.
- Overrides:
beforeInternalInit
in classInitializableObject
- Parameters:
forceReinit
- a boolean
-
afterInternalInit
protected final void afterInternalInit(boolean forceReinit) afterInternalInit.
- Overrides:
afterInternalInit
in classInitializableObject
- Parameters:
forceReinit
- a boolean
-
newDefaultCallbackUrlResolver
newDefaultCallbackUrlResolver.
- Returns:
- a
CallbackUrlResolver
object
-
getRedirectionAction
Return the redirection action to the authentication provider (indirect clients).
If an authentication has already been tried for this client and has failed (
null
credentials) or if the request is an AJAX one, an unauthorized response is thrown instead of a "redirection".- Parameters:
ctx
- the current context- Returns:
- the redirection to perform (optional)
-
checkCredentials
Check the credentials.- Overrides:
checkCredentials
in classBaseClient
- Parameters:
ctx
- the contextcredentials
- the credentials
-
processLogout
Process the logout.- Parameters:
ctx
- the current contextcredentials
- the logout credentials- Returns:
- the resulting HTTP action
-
getLogoutAction
public final Optional<RedirectionAction> getLogoutAction(CallContext ctx, UserProfile currentProfile, String targetUrl) Return the logout action (indirect clients).
- Parameters:
ctx
- the current contextcurrentProfile
- the currentProfiletargetUrl
- the target url after logout- Returns:
- the redirection to perform (optional)
-
computeFinalCallbackUrl
computeFinalCallbackUrl.
- Parameters:
context
- aWebContext
object- Returns:
- a
String
object
-
getStateSessionAttributeName
getStateSessionAttributeName.
- Returns:
- a
String
object
-
getNonceSessionAttributeName
getNonceSessionAttributeName.
- Returns:
- a
String
object
-
getCodeVerifierSessionAttributeName
getCodeVerifierSessionAttributeName.
- Returns:
- a
String
object
-
setRedirectionActionBuilderIfUndefined
protected void setRedirectionActionBuilderIfUndefined(RedirectionActionBuilder redirectActionBuilder) setRedirectionActionBuilderIfUndefined.
- Parameters:
redirectActionBuilder
- aRedirectionActionBuilder
object
-
setLogoutProcessorIfUndefined
setLogoutProcessorIfUndefined.
- Parameters:
logoutProcessor
- aLogoutProcessor
object
-
setLogoutActionBuilderIfUndefined
setLogoutActionBuilderIfUndefined.
- Parameters:
logoutActionBuilder
- aLogoutActionBuilder
object
-