Package org.pac4j.core.client
Class DirectClient<C extends Credentials>
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.client.BaseClient<C>
-
- org.pac4j.core.client.DirectClient<C>
-
- All Implemented Interfaces:
Client<C>
- Direct Known Subclasses:
AnonymousClient
public abstract class DirectClient<C extends Credentials> extends BaseClient<C>
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
-
-
Constructor Summary
Constructors Constructor Description DirectClient()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
clientInit()
Initialize the client.Optional<C>
getCredentials(WebContext context)
Get the credentials from the web context.Optional<RedirectionAction>
getLogoutAction(WebContext context, UserProfile currentProfile, String targetUrl)
Return the logout action (indirect clients).Optional<RedirectionAction>
getRedirectionAction(WebContext context)
Return the redirection action to the authentication provider (indirect clients).protected void
internalInit()
Internal initialization of the object.-
Methods inherited from class org.pac4j.core.client.BaseClient
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getName, getProfileCreator, getUserProfile, notifySessionRenewal, renewUserProfile, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setName, setProfileCreator, toString
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, isInitialized
-
-
-
-
Method Detail
-
internalInit
protected final void internalInit()
Description copied from class:InitializableObject
Internal initialization of the object.- Specified by:
internalInit
in classInitializableObject
-
clientInit
protected abstract void clientInit()
Initialize the client.
-
getRedirectionAction
public final Optional<RedirectionAction> getRedirectionAction(WebContext context)
Description copied from interface:Client
Return the redirection action to the authentication provider (indirect clients).
- Parameters:
context
- the current web context- Returns:
- the redirection to perform (optional)
-
getCredentials
public final Optional<C> getCredentials(WebContext context)
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 context- Returns:
- the credentials (optional)
-
getLogoutAction
public final Optional<RedirectionAction> getLogoutAction(WebContext context, UserProfile currentProfile, String targetUrl)
Description copied from interface:Client
Return the logout action (indirect clients).
- Parameters:
context
- the current web contextcurrentProfile
- the currentProfiletargetUrl
- the target url after logout- Returns:
- the redirection to perform (optional)
-
-