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 protected
FormAuthContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected
FormAuthContext(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 void
authorize()
Starts the authorization flow of the current contextvoid
authorize(javax.servlet.FilterChain chain)
Starts the authorization flow of the current contextorg.pac4j.core.config.Config
buildAuthConfig()
void
callback()
Starts the callback handling of the current contextboolean
checkAuthorisation(org.pac4j.core.profile.CommonProfile profile)
Checks the authorization of the given profiles against the current contextorg.pac4j.core.config.Config
getAuthConfig()
Returns the current configuration of the authentication context.List<IAuthenticatorConfigWrapper>
getAuthConfigOptions()
String
getAuthenticatorToken()
Get the token of the currentIAuthenticator
or the name of an internal authenticatorString
getBaseUrl()
Get the current base URLMandant
getClient()
Get the client to which the form belongs.FRQSession
getFRQSession()
Get the current form request session to authenticate withLocale
getLocale()
Returns the locale of the auth contextLinkedHashMap<String,ProjectAuthenticatorConfig>
getProjectAuthConfig()
Deprecated.javax.servlet.http.HttpServletRequest
getRequest()
Returns the HTTP servlet requestjavax.servlet.http.HttpServletResponse
getResponse()
Returns the HTTP servlet responseIAuthenticatorConfigWrapper
getTokenAuthConfig()
void
logout()
Starts the logout from the given authorizationsvoid
logout(javax.servlet.FilterChain chain)
Starts the logout from the given authorizationsvoid
setAuthenticatorToken(String authenticatorToken)
Set the token of the currentIAuthenticator
void
setFRQSession(FRQSession frqSession)
void
setProject(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:IFormAuthContext
Get the token of the currentIAuthenticator
or the name of an internal authenticator- Specified by:
getAuthenticatorToken
in interfaceIFormAuthContext
- Returns:
String
token or name
-
setAuthenticatorToken
public void setAuthenticatorToken(String authenticatorToken)
Description copied from interface:IFormAuthContext
Set the token of the currentIAuthenticator
- Specified by:
setAuthenticatorToken
in interfaceIFormAuthContext
- Parameters:
authenticatorToken
- The token of the currentIAuthenticator
or the name of an internal authenticator.
-
getTokenAuthConfig
public IAuthenticatorConfigWrapper getTokenAuthConfig()
- Specified by:
getTokenAuthConfig
in interfaceIFormAuthContext
- Returns:
- the
IAuthenticatorConfigWrapper
for a given authenticator token
-
getAuthConfigOptions
public List<IAuthenticatorConfigWrapper> getAuthConfigOptions()
- Specified by:
getAuthConfigOptions
in interfaceIFormAuthContext
- Returns:
- A
List
of all available authenticator configs
-
getClient
public Mandant getClient()
Description copied from interface:IFormAuthContext
Get the client to which the form belongs.- Specified by:
getClient
in interfaceIFormAuthContext
- Returns:
- The current
Mandant
to which the form belongs.
-
getBaseUrl
public String getBaseUrl()
Description copied from interface:IFormAuthContext
Get the current base URL- Specified by:
getBaseUrl
in interfaceIFormAuthContext
- Returns:
String
the base URL
-
setProject
public void setProject(Projekt project)
-
getFRQSession
public FRQSession getFRQSession()
Description copied from interface:IFormAuthContext
Get the current form request session to authenticate with- Specified by:
getFRQSession
in interfaceIFormAuthContext
- Returns:
FRQSession
to authenticate
-
setFRQSession
public void setFRQSession(FRQSession frqSession)
-
getLocale
public Locale getLocale()
Description copied from interface:IFormAuthContext
Returns the locale of the auth context- Specified by:
getLocale
in interfaceIFormAuthContext
- Returns:
Locale
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface:IFormAuthContext
Returns the HTTP servlet request- Specified by:
getRequest
in interfaceIFormAuthContext
- Returns:
HttpServletRequest
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
Description copied from interface:IFormAuthContext
Returns the HTTP servlet response- Specified by:
getResponse
in interfaceIFormAuthContext
- Returns:
- HttpServletResponse
-
getAuthConfig
public org.pac4j.core.config.Config getAuthConfig()
Description copied from interface:IFormAuthContext
Returns the current configuration of the authentication context. If no configuration is present, the configuration will be build and saved.- Specified by:
getAuthConfig
in 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:IFormAuthContext
Checks the authorization of the given profiles against the current context- Specified by:
checkAuthorisation
in interfaceIFormAuthContext
- Parameters:
profile
- ACommonProfile
to check- Returns:
true
if authorized, orfalse
otherwise.
-
authorize
public void authorize()
Description copied from interface:IFormAuthContext
Starts the authorization flow of the current context- Specified by:
authorize
in interfaceIFormAuthContext
-
authorize
public void authorize(javax.servlet.FilterChain chain)
Description copied from interface:IFormAuthContext
Starts the authorization flow of the current context- Specified by:
authorize
in interfaceIFormAuthContext
- Parameters:
chain
-FilterChain
to process after the authorization
-
logout
public void logout()
Description copied from interface:IFormAuthContext
Starts the logout from the given authorizations- Specified by:
logout
in interfaceIFormAuthContext
-
logout
public void logout(javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
Description copied from interface:IFormAuthContext
Starts the logout from the given authorizations- Specified by:
logout
in interfaceIFormAuthContext
- Parameters:
chain
-FilterChain
to 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:IFormAuthContext
Starts the callback handling of the current context- Specified by:
callback
in interfaceIFormAuthContext
-
getProjectAuthConfig
@Deprecated public LinkedHashMap<String,ProjectAuthenticatorConfig> getProjectAuthConfig()
Deprecated.- Specified by:
getProjectAuthConfig
in interfaceIFormAuthContext
-
-