Package de.xima.fc.web.common.auth
Class FormAuthContext
java.lang.Object
de.xima.fc.web.common.auth.FormAuthContext
- All Implemented Interfaces:
IAuthWebContext,IFormAuthContext
The authentication context for an form
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Deprecated.protectedFormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Mandant client) -
Method Summary
Modifier and TypeMethodDescriptionorg.pac4j.core.config.ConfigDeprecated.Since 7.2.0.org.pac4j.core.config.ConfigbuildAuthConfig(EAuthenticationFlow authFlow) voidcallback()Starts the callback handling of the current context.booleancheckAuthorisation(org.pac4j.core.profile.UserProfile profile) Checks the authorization of the given profiles against the current contextbooleancheckAuthorization(IUser user) org.pac4j.core.config.ConfiggetAuthConfig(EAuthenticationFlow authFlow) Returns the current configuration of the authentication context for the given authentication flow.Deprecated.Returns the descriptor for the indirect client that may be executed automatically.Get the current base URLGet the client to which the form belongs.Returns an ordered list of the clients for each configured authenticator.List<org.pac4j.core.client.Client>getClients(EAuthenticationFlow authFlow) Returns an ordered list of the clients for the given authentication flow.Get the current form request session to authenticate withReturns the locale of the auth contextorg.pac4j.core.profile.ProfileManagerDeprecated.javax.servlet.http.HttpServletRequestReturns the HTTP servlet requestjavax.servlet.http.HttpServletResponseReturns the HTTP servlet responseorg.pac4j.core.context.session.SessionStoreorg.pac4j.core.context.WebContextlogin(EAuthenticationFlow authFlow) Starts the login logic for the given authentication flow.login(javax.servlet.FilterChain chain, EAuthenticationFlow authFlow) Starts the login logic for the given authentication flow.voidlogout()Starts the logout from the given authorizations.voidlogout(javax.servlet.FilterChain chain) Starts the logout from the given authorizationsvoidsetAuthenticatorToken(String authenticatorToken) Deprecated.voidsetFRQSession(FRQSession frqSession) voidsetProject(Projekt project) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.interfaces.auth.IFormAuthContext
authorize, authorize, getAuthConfig
-
Constructor Details
-
FormAuthContext
@Deprecated protected FormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Deprecated. -
FormAuthContext
protected FormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Mandant client)
-
-
Method Details
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()Description copied from interface:IFormAuthContextReturns the HTTP servlet request- Specified by:
getRequestin interfaceIAuthWebContext- Specified by:
getRequestin interfaceIFormAuthContext- Returns:
HttpServletRequest
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()Description copied from interface:IFormAuthContextReturns the HTTP servlet response- Specified by:
getResponsein interfaceIAuthWebContext- Specified by:
getResponsein interfaceIFormAuthContext- Returns:
- HttpServletResponse
-
getAuthenticationTarget
- Specified by:
getAuthenticationTargetin interfaceIAuthWebContext- Returns:
- the authentication target which describes what purpose the authentication is intended for.
-
getWebContext
@NotNull public org.pac4j.core.context.WebContext getWebContext()- Specified by:
getWebContextin interfaceIAuthWebContext- Returns:
- the pac4j web context
-
getSessionStore
public org.pac4j.core.context.session.SessionStore getSessionStore()- Specified by:
getSessionStorein interfaceIAuthWebContext- Returns:
- the pac4j session store
-
getProfileManager
@NotNull public org.pac4j.core.profile.ProfileManager getProfileManager()- Specified by:
getProfileManagerin interfaceIAuthWebContext- Returns:
- the pac4j profile manager
-
getTokenAuthConfig
- Specified by:
getTokenAuthConfigin interfaceIFormAuthContext- Returns:
- the
IAuthenticatorConfigWrapperfor a given authenticator token
-
getAuthConfigOptions
- Specified by:
getAuthConfigOptionsin interfaceIFormAuthContext- Returns:
- A
Listof all available authenticator configs
-
getClient
Description copied from interface:IFormAuthContextGet the client to which the form belongs.- Specified by:
getClientin interfaceIFormAuthContext- Returns:
- The current
Mandantto which the form belongs.
-
getBaseUrl
Description copied from interface:IFormAuthContextGet the current base URL- Specified by:
getBaseUrlin interfaceIAuthWebContext- Specified by:
getBaseUrlin interfaceIFormAuthContext- Returns:
Stringthe base URL
-
setProject
-
getFRQSession
Description copied from interface:IFormAuthContextGet the current form request session to authenticate with- Specified by:
getFRQSessionin interfaceIFormAuthContext- Returns:
FRQSessionto authenticate
-
setFRQSession
-
getLocale
Description copied from interface:IFormAuthContextReturns the locale of the auth context- Specified by:
getLocalein interfaceIFormAuthContext- Returns:
Locale
-
getAuthConfig
Description copied from interface:IFormAuthContextReturns the current configuration of the authentication context for the given authentication flow. If no configuration is present, the configuration will be build and saved.- Specified by:
getAuthConfigin interfaceIFormAuthContext- Parameters:
authFlow- the authentication flow for which to get the authentication configuration.- Returns:
- The existing or newly created
Config.
-
getClients
Description copied from interface:IFormAuthContextReturns an ordered list of the clients for each configured authenticator.- Specified by:
getClientsin interfaceIFormAuthContext- Returns:
- An ordered list of the clients for each configured authenticator.
-
getClients
Description copied from interface:IFormAuthContextReturns an ordered list of the clients for the given authentication flow. If the clients have not been created for the given authentication flow they will be created.- Specified by:
getClientsin interfaceIFormAuthContext- Parameters:
authFlow- The authentication flow for which to get the clients.- Returns:
- An ordered list of the clients for the given authentication flow.
-
getAutoExecutableIndirectClient
Description copied from interface:IFormAuthContextReturns the descriptor for the indirect client that may be executed automatically. There may only be an auto executable indirect client iff only one authenticator is configured for the access to the form. Automatic execution of the client will result in immediate redirection to the IDP defined by the client when accessing the form.- Specified by:
getAutoExecutableIndirectClientin interfaceIFormAuthContext- Returns:
- the descriptor of the indirect client that may be executed automatically if it exists and
nullotherwise.
-
buildAuthConfig
-
checkAuthorization
- Specified by:
checkAuthorizationin interfaceIFormAuthContext
-
checkAuthorisation
public boolean checkAuthorisation(org.pac4j.core.profile.UserProfile profile) Description copied from interface:IFormAuthContextChecks the authorization of the given profiles against the current context- Specified by:
checkAuthorisationin interfaceIFormAuthContext- Parameters:
profile- ACommonProfileto check- Returns:
trueif authorized, orfalseotherwise.
-
login
Description copied from interface:IFormAuthContextStarts the login logic for the given authentication flow.- Specified by:
loginin interfaceIFormAuthContext- Parameters:
authFlow- the authentication flow for which to perform the authorization flow.- Returns:
- the created user profile or
null
-
login
Description copied from interface:IFormAuthContextStarts the login logic for the given authentication flow.- Specified by:
loginin interfaceIFormAuthContext- Parameters:
chain-FilterChainto process after the authorization ornullauthFlow- the authentication flow for which to perform the authorization flow.- Returns:
- the created user profile or
null
-
callback
public void callback()Description copied from interface:IFormAuthContextStarts the callback handling of the current context.- Specified by:
callbackin interfaceIFormAuthContext
-
logout
public void logout()Description copied from interface:IFormAuthContextStarts the logout from the given authorizations.- Specified by:
logoutin interfaceIFormAuthContext
-
logout
public void logout(javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException Description copied from interface:IFormAuthContextStarts the logout from the given authorizations- Specified by:
logoutin interfaceIFormAuthContext- Parameters:
chain-FilterChainto process after the logout- Throws:
IOException- IO-errors while processing the chainjavax.servlet.ServletException- Servlet-errors while processing the chain
-
buildAuthConfig
Deprecated.Since 7.2.0. UsebuildAuthConfig(EAuthenticationFlow)instead. -
getProjectAuthConfig
Deprecated.- Specified by:
getProjectAuthConfigin interfaceIFormAuthContext
-
getAuthenticatorToken
Deprecated.Description copied from interface:IFormAuthContextGet the token of the currentIAuthenticatoror the name of an internal authenticator- Specified by:
getAuthenticatorTokenin interfaceIFormAuthContext- Returns:
Stringtoken or name
-
setAuthenticatorToken
Deprecated.Description copied from interface:IFormAuthContextSet the token of the currentIAuthenticator- Specified by:
setAuthenticatorTokenin interfaceIFormAuthContext- Parameters:
authenticatorToken- The token of the currentIAuthenticatoror the name of an internal authenticator.
-
FormAuthContext(HttpServletRequest, HttpServletResponse, Mandant)instead.