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 org.craftercms.profile.api.services.ProfileServiceprotected org.craftercms.profile.api.services.TenantServiceprotected TenantsResolverprotected Stringprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.craftercms.profile.api.ProfilecreateProfileWithSsoInfo(String username, org.craftercms.profile.api.Tenant tenant, javax.servlet.http.HttpServletRequest request) protected org.craftercms.profile.api.TenantgetSsoEnabledTenant(String[] tenantNames) protected booleanhasValidToken(javax.servlet.http.HttpServletRequest request) voidprocessRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) Processes a request, enforcing security when required.voidsetAuthenticationManager(AuthenticationManager authenticationManager) voidsetEmailHeaderName(String emailHeaderName) voidsetMellonHeaderPrefix(String mellonHeaderPrefix) voidsetProfileService(org.craftercms.profile.api.services.ProfileService profileService) voidsetTenantService(org.craftercms.profile.api.services.TenantService tenantService) voidsetTenantsResolver(TenantsResolver tenantsResolver) 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
protected org.craftercms.profile.api.services.TenantService tenantService -
profileService
protected org.craftercms.profile.api.services.ProfileService profileService -
tenantsResolver
-
authenticationManager
-
mellonHeaderPrefix
-
usernameHeaderName
-
emailHeaderName
-
tokenHeaderName
-
tokenExpectedValue
-
-
Constructor Details
-
AuthenticationHeadersLoginProcessor
public AuthenticationHeadersLoginProcessor()
-
-
Method Details
-
setTenantService
public void setTenantService(org.craftercms.profile.api.services.TenantService tenantService) -
setProfileService
public void setProfileService(org.craftercms.profile.api.services.ProfileService profileService) -
setTenantsResolver
-
setAuthenticationManager
-
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(javax.servlet.http.HttpServletRequest request) -
getSsoEnabledTenant
protected org.craftercms.profile.api.Tenant getSsoEnabledTenant(String[] tenantNames) throws org.craftercms.profile.api.exceptions.ProfileException - Throws:
org.craftercms.profile.api.exceptions.ProfileException
-
createProfileWithSsoInfo
protected org.craftercms.profile.api.Profile createProfileWithSsoInfo(String username, org.craftercms.profile.api.Tenant tenant, javax.servlet.http.HttpServletRequest request) throws org.craftercms.profile.api.exceptions.ProfileException - Throws:
org.craftercms.profile.api.exceptions.ProfileException
-