public class X509AuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware
Migrated from Spring Security 2 since it has been removed in Spring Security 3.
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.support.MessageSourceAccessor |
messages |
Constructor and Description |
---|
X509AuthenticationProvider() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
If the supplied authentication token contains a certificate then this will be passed to the configured
X509AuthoritiesPopulator to obtain the user details and authorities for the user identified by the
certificate. |
void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
void |
setX509AuthoritiesPopulator(X509AuthoritiesPopulator x509AuthoritiesPopulator) |
void |
setX509UserCache(X509UserCache cache) |
boolean |
supports(Class authentication) |
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
X509AuthoritiesPopulator
to obtain the user details and authorities for the user identified by the
certificate.If no certificate is present (for example, if the filter is applied to an HttpRequest for which client authentication hasn't been configured in the container) then a BadCredentialsException will be raised.
authenticate
in interface org.springframework.security.authentication.AuthenticationProvider
authentication
- the authentication request.org.springframework.security.core.AuthenticationException
- if the X509AuthoritiesPopulator
rejects the certficate.org.springframework.security.authentication.BadCredentialsException
- if no certificate was presented in the authentication request.public void setMessageSource(org.springframework.context.MessageSource messageSource)
setMessageSource
in interface org.springframework.context.MessageSourceAware
public void setX509AuthoritiesPopulator(X509AuthoritiesPopulator x509AuthoritiesPopulator)
public void setX509UserCache(X509UserCache cache)
public boolean supports(Class authentication)
supports
in interface org.springframework.security.authentication.AuthenticationProvider
Copyright © 2005–2016 The Spring Web Services Framework. All rights reserved.