|
Spring Security SAML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.security.saml.SAMLAuthenticationProvider
public class SAMLAuthenticationProvider
Authentication provider is capable of verifying validity of a SAMLAuthenticationToken and in case the token is valid to create an authenticated UsernamePasswordAuthenticationToken.
Field Summary | |
---|---|
protected WebSSOProfileConsumer |
consumer
|
protected WebSSOProfileConsumer |
hokConsumer
|
protected SAMLLogger |
samlLogger
|
protected SAMLUserDetailsService |
userDetails
|
Constructor Summary | |
---|---|
SAMLAuthenticationProvider()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Verifies that required entities were autowired or set. |
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
Attempts to perform authentication of an Authentication object. |
protected Collection<? extends org.springframework.security.core.GrantedAuthority> |
getEntitlements(SAMLCredential credential,
Object userDetail)
Method is responsible for returning collection of users entitlements. |
protected Date |
getExpirationDate(SAMLCredential credential)
Parses the SAMLCredential for expiration time. |
protected Object |
getPrincipal(SAMLCredential credential,
Object userDetail)
Method determines what will be stored as principal of the created Authentication object. |
SAMLUserDetailsService |
getUserDetails()
Returns saml user details service used to load information about logged user from SAML data. |
protected Object |
getUserDetails(SAMLCredential credential)
Populates user data from SAMLCredential into UserDetails object. |
boolean |
isForcePrincipalAsString()
|
void |
setConsumer(WebSSOProfileConsumer consumer)
Profile for consumption of processed messages, must be set. |
void |
setForcePrincipalAsString(boolean forcePrincipalAsString)
|
void |
setHokConsumer(WebSSOProfileConsumer hokConsumer)
Profile for consumption of processed messages using the Holder-of-Key profile, must be set. |
void |
setSamlLogger(SAMLLogger samlLogger)
Logger for SAML events, cannot be null, must be set. |
void |
setUserDetails(SAMLUserDetailsService userDetails)
The user details can be optionally set and is automatically called while user SAML assertion is validated. |
boolean |
supports(Class aClass)
SAMLAuthenticationToken is the only supported token. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected WebSSOProfileConsumer consumer
protected WebSSOProfileConsumer hokConsumer
protected SAMLLogger samlLogger
protected SAMLUserDetailsService userDetails
Constructor Detail |
---|
public SAMLAuthenticationProvider()
Method Detail |
---|
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
authenticate
in interface org.springframework.security.authentication.AuthenticationProvider
authentication
- SAMLAuthenticationToken to verify
org.springframework.security.core.AuthenticationException
- user can't be authenticated due to an errorprotected Object getUserDetails(SAMLCredential credential)
credential
- credential to load user from
protected Object getPrincipal(SAMLCredential credential, Object userDetail)
credential
- credential used to authenticate useruserDetail
- loaded user details, can be null
protected Collection<? extends org.springframework.security.core.GrantedAuthority> getEntitlements(SAMLCredential credential, Object userDetail)
credential
- credential used to authenticate user during SSOuserDetail
- user detail object returned from getUserDetails call
protected Date getExpirationDate(SAMLCredential credential)
credential
- credential to use for expiration parsing.
public SAMLUserDetailsService getUserDetails()
public boolean supports(Class aClass)
supports
in interface org.springframework.security.authentication.AuthenticationProvider
aClass
- class to check for support
@Autowired(required=false) public void setUserDetails(SAMLUserDetailsService userDetails)
userDetails
- user details@Autowired public void setSamlLogger(SAMLLogger samlLogger)
samlLogger
- logger@Autowired @Qualifier(value="webSSOprofileConsumer") public void setConsumer(WebSSOProfileConsumer consumer)
consumer
- consumer@Autowired @Qualifier(value="hokWebSSOprofileConsumer") public void setHokConsumer(WebSSOProfileConsumer hokConsumer)
hokConsumer
- holder-of-key consumerpublic boolean isForcePrincipalAsString()
public void setForcePrincipalAsString(boolean forcePrincipalAsString)
public void afterPropertiesSet() throws ServletException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
ServletException
|
Spring Security SAML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |