Package de.xima.fc.web.common.auth
Class FormAuthContext
- java.lang.Object
-
- de.xima.fc.web.common.auth.FormAuthContext
-
- All Implemented Interfaces:
IFormAuthContext,Serializable
public class FormAuthContext extends Object implements IFormAuthContext
The authentication context for an form- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protectedFormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Mandant client)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidauthorize()Starts the authorization flow of the current contextvoidauthorize(javax.servlet.FilterChain chain)Starts the authorization flow of the current contextorg.pac4j.core.config.ConfigbuildAuthConfig()voidcallback()Starts the callback handling of the current contextbooleancheckAuthorisation(org.pac4j.core.profile.CommonProfile profile)Checks the authorization of the given profiles against the current contextorg.pac4j.core.config.ConfiggetAuthConfig()Returns the current configuration of the authentication context.List<IAuthenticatorConfigWrapper>getAuthConfigOptions()StringgetAuthenticatorToken()Get the token of the currentIAuthenticatoror the name of an internal authenticatorStringgetBaseUrl()Get the current base URLMandantgetClient()Get the client to which the form belongs.FRQSessiongetFRQSession()Get the current form request session to authenticate withLocalegetLocale()Returns the locale of the auth contextLinkedHashMap<String,ProjectAuthenticatorConfig>getProjectAuthConfig()Deprecated.javax.servlet.http.HttpServletRequestgetRequest()Returns the HTTP servlet requestjavax.servlet.http.HttpServletResponsegetResponse()Returns the HTTP servlet responseIAuthenticatorConfigWrappergetTokenAuthConfig()voidlogout()Starts the logout from the given authorizationsvoidlogout(javax.servlet.FilterChain chain)Starts the logout from the given authorizationsvoidsetAuthenticatorToken(String authenticatorToken)Set the token of the currentIAuthenticatorvoidsetFRQSession(FRQSession frqSession)voidsetProject(Projekt project)
-
-
-
Constructor Detail
-
FormAuthContext
@Deprecated protected FormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
- Parameters:
request-response-
-
FormAuthContext
protected FormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Mandant client)
-
-
Method Detail
-
getAuthenticatorToken
public String getAuthenticatorToken()
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
public void setAuthenticatorToken(String authenticatorToken)
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.
-
getTokenAuthConfig
public IAuthenticatorConfigWrapper getTokenAuthConfig()
- Specified by:
getTokenAuthConfigin interfaceIFormAuthContext- Returns:
- the
IAuthenticatorConfigWrapperfor a given authenticator token
-
getAuthConfigOptions
public List<IAuthenticatorConfigWrapper> getAuthConfigOptions()
- Specified by:
getAuthConfigOptionsin interfaceIFormAuthContext- Returns:
- A
Listof all available authenticator configs
-
getClient
public Mandant 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
public String getBaseUrl()
Description copied from interface:IFormAuthContextGet the current base URL- Specified by:
getBaseUrlin interfaceIFormAuthContext- Returns:
Stringthe base URL
-
setProject
public void setProject(Projekt project)
-
getFRQSession
public FRQSession getFRQSession()
Description copied from interface:IFormAuthContextGet the current form request session to authenticate with- Specified by:
getFRQSessionin interfaceIFormAuthContext- Returns:
FRQSessionto authenticate
-
setFRQSession
public void setFRQSession(FRQSession frqSession)
-
getLocale
public Locale getLocale()
Description copied from interface:IFormAuthContextReturns the locale of the auth context- Specified by:
getLocalein interfaceIFormAuthContext- Returns:
Locale
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface:IFormAuthContextReturns the HTTP servlet request- 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 interfaceIFormAuthContext- Returns:
- HttpServletResponse
-
getAuthConfig
public org.pac4j.core.config.Config getAuthConfig()
Description copied from interface:IFormAuthContextReturns the current configuration of the authentication context. If no configuration is present, the configuration will be build and saved.- Specified by:
getAuthConfigin interfaceIFormAuthContext- Returns:
- The existing or newly created
Config.
-
buildAuthConfig
public org.pac4j.core.config.Config buildAuthConfig()
-
checkAuthorisation
public boolean checkAuthorisation(org.pac4j.core.profile.CommonProfile 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.
-
authorize
public void authorize()
Description copied from interface:IFormAuthContextStarts the authorization flow of the current context- Specified by:
authorizein interfaceIFormAuthContext
-
authorize
public void authorize(javax.servlet.FilterChain chain)
Description copied from interface:IFormAuthContextStarts the authorization flow of the current context- Specified by:
authorizein interfaceIFormAuthContext- Parameters:
chain-FilterChainto process after the authorization
-
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.ServletExceptionDescription 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
-
callback
public void callback()
Description copied from interface:IFormAuthContextStarts the callback handling of the current context- Specified by:
callbackin interfaceIFormAuthContext
-
getProjectAuthConfig
@Deprecated public LinkedHashMap<String,ProjectAuthenticatorConfig> getProjectAuthConfig()
Deprecated.- Specified by:
getProjectAuthConfigin interfaceIFormAuthContext
-
-