Package org.pac4j.core.client
Class DirectClient
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.client.BaseClient
-
- org.pac4j.core.client.DirectClient
-
- All Implemented Interfaces:
Client
- Direct Known Subclasses:
AnonymousClient
public abstract class DirectClient extends BaseClient
Direct client: credentials are passed and authentication occurs for every HTTP request.- Since:
- 1.9.0
- Author:
- Jerome Leleu
-
-
Field Summary
-
Fields inherited from class org.pac4j.core.client.BaseClient
logger, saveProfileInSession
-
-
Constructor Summary
Constructors Constructor Description DirectClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterInternalInit()
protected void
beforeInternalInit()
java.util.Optional<Credentials>
getCredentials(WebContext context, SessionStore sessionStore)
Get the credentials from the web context.java.util.Optional<RedirectionAction>
getLogoutAction(WebContext context, SessionStore sessionStore, UserProfile currentProfile, java.lang.String targetUrl)
Return the logout action (indirect clients).java.util.Optional<RedirectionAction>
getRedirectionAction(WebContext context, SessionStore sessionStore)
Return the redirection action to the authentication provider (indirect clients).java.lang.String
toString()
-
Methods inherited from class org.pac4j.core.client.BaseClient
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getSaveProfileInSession, getUserProfile, isMultiProfile, notifySessionRenewal, renewUserProfile, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setMultiProfile, setName, setProfileCreator, setProfileFactoryWhenNotAuthenticated, setSaveProfileInSession
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, internalInit, isInitialized
-
-
-
-
Method Detail
-
beforeInternalInit
protected void beforeInternalInit()
- Overrides:
beforeInternalInit
in classInitializableObject
-
afterInternalInit
protected final void afterInternalInit()
- Overrides:
afterInternalInit
in classInitializableObject
-
getRedirectionAction
public final java.util.Optional<RedirectionAction> getRedirectionAction(WebContext context, SessionStore sessionStore)
Description copied from interface:Client
Return the redirection action to the authentication provider (indirect clients).
- Parameters:
context
- the current web contextsessionStore
- the session store- Returns:
- the redirection to perform (optional)
-
getCredentials
public final java.util.Optional<Credentials> getCredentials(WebContext context, SessionStore sessionStore)
Description copied from interface:Client
Get the credentials from the web context. If no validation was made remotely (direct client), credentials must be validated at this step.
- Parameters:
context
- the current web contextsessionStore
- the session store- Returns:
- the credentials (optional)
-
getLogoutAction
public final java.util.Optional<RedirectionAction> getLogoutAction(WebContext context, SessionStore sessionStore, UserProfile currentProfile, java.lang.String targetUrl)
Description copied from interface:Client
Return the logout action (indirect clients).
- Parameters:
context
- the current web contextsessionStore
- the session storecurrentProfile
- the currentProfiletargetUrl
- the target url after logout- Returns:
- the redirection to perform (optional)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classBaseClient
-
-