Package org.pac4j.http.client.indirect
Class IndirectBasicAuthClient
- java.lang.Object
-
- org.pac4j.core.util.InitializableObject
-
- org.pac4j.core.client.BaseClient<C>
-
- org.pac4j.core.client.IndirectClient<UsernamePasswordCredentials>
-
- org.pac4j.http.client.indirect.IndirectBasicAuthClient
-
- All Implemented Interfaces:
Client<UsernamePasswordCredentials>
public class IndirectBasicAuthClient extends IndirectClient<UsernamePasswordCredentials>
This class is the client to authenticate users through HTTP basic auth. It was previously named:
BasicAuthClient
.For authentication, the user is redirected to the callback url. If the user is not authenticated by basic auth, a specific exception :
HttpAction
is returned which must be handled by the application to force authentication.- Since:
- 1.8.0
- Author:
- Jerome Leleu
-
-
Field Summary
-
Fields inherited from class org.pac4j.core.client.IndirectClient
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, urlResolver
-
Fields inherited from class org.pac4j.core.client.BaseClient
logger
-
-
Constructor Summary
Constructors Constructor Description IndirectBasicAuthClient()
IndirectBasicAuthClient(String realmName, Authenticator usernamePasswordAuthenticator)
IndirectBasicAuthClient(Authenticator usernamePasswordAuthenticator)
IndirectBasicAuthClient(Authenticator usernamePasswordAuthenticator, ProfileCreator profileCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clientInit()
String
getRealmName()
protected Optional<UsernamePasswordCredentials>
retrieveCredentials(WebContext context)
void
setRealmName(String realmName)
String
toString()
-
Methods inherited from class org.pac4j.core.client.IndirectClient
computeFinalCallbackUrl, defaultLogoutActionBuilder, defaultRedirectionActionBuilder, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getLogoutAction, getLogoutActionBuilder, getNonceSessionAttributeName, getRedirectionAction, getRedirectionActionBuilder, getStateSessionAttributeName, getUrlResolver, internalInit, newDefaultCallbackUrlResolver, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setLogoutActionBuilder, setRedirectionActionBuilder, setUrlResolver
-
Methods inherited from class org.pac4j.core.client.BaseClient
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getUserProfile, notifySessionRenewal, renewUserProfile, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setName, setProfileCreator, setProfileFactoryWhenNotAuthenticated
-
Methods inherited from class org.pac4j.core.util.InitializableObject
init, isInitialized
-
-
-
-
Constructor Detail
-
IndirectBasicAuthClient
public IndirectBasicAuthClient()
-
IndirectBasicAuthClient
public IndirectBasicAuthClient(Authenticator usernamePasswordAuthenticator)
-
IndirectBasicAuthClient
public IndirectBasicAuthClient(String realmName, Authenticator usernamePasswordAuthenticator)
-
IndirectBasicAuthClient
public IndirectBasicAuthClient(Authenticator usernamePasswordAuthenticator, ProfileCreator profileCreator)
-
-
Method Detail
-
clientInit
protected void clientInit()
- Specified by:
clientInit
in classIndirectClient<UsernamePasswordCredentials>
-
retrieveCredentials
protected Optional<UsernamePasswordCredentials> retrieveCredentials(WebContext context)
- Overrides:
retrieveCredentials
in classBaseClient<UsernamePasswordCredentials>
-
getRealmName
public String getRealmName()
-
setRealmName
public void setRealmName(String realmName)
-
toString
public String toString()
- Overrides:
toString
in classIndirectClient<UsernamePasswordCredentials>
-
-