Package org.pac4j.core.client
Interface Client
- All Known Implementing Classes:
AnonymousClient
,BaseClient
,DirectClient
,IndirectClient
public interface Client
This interface is the core class of the library.
It represents an authentication mechanism to validate user's credentials
and retrieve his user profile.
- Since:
- 1.4.0
- Author:
- Jerome Leleu
-
Method Summary
Modifier and TypeMethodDescriptionGet the credentials from the context.getLogoutAction
(CallContext ctx, UserProfile currentProfile, String targetUrl) Return the logout action (indirect clients).getName()
Get the name of the client.Return the redirection action to the authentication provider (indirect clients).getUserProfile
(CallContext ctx, Credentials credentials) Get the user profile based on the credentials.processLogout
(CallContext ctx, Credentials credentials) Process the logout.renewUserProfile
(CallContext ctx, UserProfile profile) Renew the user profile.validateCredentials
(CallContext ctx, Credentials credentials) Validate the credentials.
-
Method Details
-
getName
String getName()Get the name of the client.- Returns:
- the name of the client
-
getRedirectionAction
Return the redirection action to the authentication provider (indirect clients).
- Parameters:
ctx
- the current context- Returns:
- the redirection to perform (optional)
-
getCredentials
Get the credentials from the context.- Parameters:
ctx
- the current context- Returns:
- the credentials (optional)
-
validateCredentials
Validate the credentials.- Parameters:
ctx
- the current contextcredentials
- the authentication credentials- Returns:
- the credentials (optional)
-
getUserProfile
Get the user profile based on the credentials.- Parameters:
ctx
- the contextcredentials
- the authentication credentials- Returns:
- the user profile (optional)
-
renewUserProfile
Renew the user profile.- Parameters:
ctx
- the current contextprofile
- the user profile- Returns:
- the renewed user profile (optional).
-
processLogout
Process the logout.- Parameters:
ctx
- the current contextcredentials
- the logout credentials- Returns:
- the resulting HTTP action
-
getLogoutAction
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)
-