public class AuthenticationProviderConfigurer extends org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>
SAMLAuthenticationProvider for the
SAML 2.0 Service Provider.
Common strategy across most internal configurers is to first give priority to a Spring Bean if present in the
Context. If not SAMLAuthenticationProvider is present in the Spring Context, priority goes to a custom
provider provided explicitly to this configurer through the constructor. And if not provided through the constructor,
a default implementation is instantiated that is configurable through the DSL methods.
This configurer also reads the values from SAMLSSOProperties#getAuthenticationProvider() if no custom
Authentication Provider is provided, for some DSL methods if they are not used. In other words, the user is able to
configure the Authentication Provider through the following properties:
saml.sso.authentication-provider.force-principal-as-string
saml.sso.authentication-provider.exclude-credential
| Constructor and Description |
|---|
AuthenticationProviderConfigurer()
Default Constructor
|
AuthenticationProviderConfigurer(org.springframework.security.saml.SAMLAuthenticationProvider provider)
Provide the provider to be used.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(ServiceProviderBuilder builder) |
AuthenticationProviderConfigurer |
excludeCredential(boolean excludeCredential)
When false (default) the resulting Authentication object will include instance of SAMLCredential as a credential
value.
|
AuthenticationProviderConfigurer |
forcePrincipalAsString(boolean forcePrincipalAsString)
By default principal in the returned Authentication object is the NameID included in the authenticated
Assertion.
|
void |
init(ServiceProviderBuilder builder) |
AuthenticationProviderConfigurer |
userDetailsService(org.springframework.security.saml.userdetails.SAMLUserDetailsService userDetailsService)
The user details can be optionally set and is automatically called while user SAML assertion is validated.
|
public AuthenticationProviderConfigurer(org.springframework.security.saml.SAMLAuthenticationProvider provider)
provider - the SAMLAuthenticationProvider to be used.public AuthenticationProviderConfigurer()
public void init(ServiceProviderBuilder builder) throws Exception
init in interface org.springframework.security.config.annotation.SecurityConfigurer<Void,ServiceProviderBuilder>init in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>Exceptionpublic void configure(ServiceProviderBuilder builder) throws Exception
configure in interface org.springframework.security.config.annotation.SecurityConfigurer<Void,ServiceProviderBuilder>configure in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<Void,ServiceProviderBuilder>Exceptionpublic AuthenticationProviderConfigurer excludeCredential(boolean excludeCredential)
false.
Alternatively use property:
saml.sso.authentication-provider.exclude-credential
excludeCredential - false to include credential in the Authentication object, true to exclude itpublic AuthenticationProviderConfigurer forcePrincipalAsString(boolean forcePrincipalAsString)
false.
Alternatively use property:
saml.sso.authentication-provider.force-principal-as-string
forcePrincipalAsString - true to force principal to be a Stringpublic AuthenticationProviderConfigurer userDetailsService(org.springframework.security.saml.userdetails.SAMLUserDetailsService userDetailsService)
userDetailsService - the user details service to use.Copyright © 2018. All rights reserved.