Class AuthenticationHeadersLoginProcessor
java.lang.Object
org.craftercms.security.processors.impl.AuthenticationHeadersLoginProcessor
- All Implemented Interfaces:
RequestSecurityProcessor
RequestSecurityProcessor that auto logins a user through the headers
provided by the Apache mod_auth_mellon SAML authentication module. If the user doesn't exist, it creates it.- Author:
- avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthenticationManagerstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final org.slf4j.Loggerprotected Stringprotected ProfileServiceprotected TenantServiceprotected TenantsResolverprotected Stringprotected Stringprotected String -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationHeadersLoginProcessor(TenantService tenantService, ProfileService profileService, TenantsResolver tenantsResolver, AuthenticationManager authenticationManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected ProfilecreateProfileWithSsoInfo(String username, Tenant tenant, jakarta.servlet.http.HttpServletRequest request) protected TenantgetSsoEnabledTenant(String[] tenantNames) protected booleanhasValidToken(jakarta.servlet.http.HttpServletRequest request) voidprocessRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) Processes a request, enforcing security when required.voidsetEmailHeaderName(String emailHeaderName) voidsetMellonHeaderPrefix(String mellonHeaderPrefix) voidsetTokenExpectedValue(String tokenExpectedValue) voidsetTokenHeaderName(String tokenHeaderName) voidsetUsernameHeaderName(String usernameHeaderName)
-
Field Details
-
logger
public static final org.slf4j.Logger logger -
DEFAULT_MELLON_HEADER_PREFIX
- See Also:
-
DEFAULT_USERNAME_HEADER_NAME
- See Also:
-
DEFAULT_EMAIL_HEADER_NAME
- See Also:
-
DEFAULT_TOKEN_HEADER_NAME
- See Also:
-
tenantService
-
profileService
-
tenantsResolver
-
authenticationManager
-
mellonHeaderPrefix
-
usernameHeaderName
-
emailHeaderName
-
tokenHeaderName
-
tokenExpectedValue
-
-
Constructor Details
-
AuthenticationHeadersLoginProcessor
public AuthenticationHeadersLoginProcessor(TenantService tenantService, ProfileService profileService, TenantsResolver tenantsResolver, AuthenticationManager authenticationManager)
-
-
Method Details
-
setMellonHeaderPrefix
-
setUsernameHeaderName
-
setEmailHeaderName
-
setTokenHeaderName
-
setTokenExpectedValue
-
getTokenExpectedValue
-
processRequest
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception Description copied from interface:RequestSecurityProcessorProcesses a request, enforcing security when required.- Specified by:
processRequestin interfaceRequestSecurityProcessor- Parameters:
context- the context which holds the current request and responseprocessorChain- theRequestSecurityProcessorChain, used to call the next processor- Throws:
Exception
-
hasValidToken
protected boolean hasValidToken(jakarta.servlet.http.HttpServletRequest request) -
getSsoEnabledTenant
- Throws:
ProfileException
-
createProfileWithSsoInfo
protected Profile createProfileWithSsoInfo(String username, Tenant tenant, jakarta.servlet.http.HttpServletRequest request) throws ProfileException - Throws:
ProfileException
-