Class Saml2AuthnRequestAuthenticationProviderConfigurer
java.lang.Object
se.swedenconnect.spring.saml.idp.config.configurers.Saml2AuthnRequestAuthenticationProviderConfigurer
A configurer for configuring the
Saml2AuthnRequestAuthenticationProvider
.- Author:
- Martin Lindström
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassertionConsumerServiceValidator
(AuthnRequestValidator assertionConsumerServiceValidator) Assigns a custom assertion consumer serviceAuthnRequestValidator
.protected static List
<RequestedAttributeProcessor> createDefaultRequestedAttributeProcessors
(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) Gets the default set ofRequestedAttributeProcessor
s.messageReplayChecker
(MessageReplayChecker messageReplayChecker) Assigns aMessageReplayChecker
to theAuthnRequestReplayValidator
.nameIDGeneratorFactory
(NameIDGeneratorFactory nameIDGeneratorFactory) Assigns a customNameIDGeneratorFactory
.principalSelectionProcessor
(PrincipalSelectionProcessor principalSelectionProcessor) Assigns a customPrincipalSelectionProcessor
.replayValidator
(AuthnRequestValidator replayValidator) Assigns a replay validator.requestedAttributeProcessors
(Consumer<List<RequestedAttributeProcessor>> customizer) Gives access to the list ofRequestedAttributeProcessor
s.serviceProviderFilter
(Saml2ServiceProviderFilter serviceProviderFilter) Assigns aSaml2ServiceProviderFilter
.signatureMessageExtensionExtractor
(SignatureMessageExtensionExtractor signatureMessageExtensionExtractor) Assigns a customSignatureMessageExtensionExtractor
.signatureMessagePreprocessor
(SignatureMessagePreprocessor signatureMessagePreprocessor) Assigns aSignatureMessagePreprocessor
that is used to prepare received sign messages for display.signatureValidator
(AuthnRequestValidator signatureValidator) Assigns a customAuthnRequestValidator
for validating the signatures ofAuthnRequest
messages.userMessagePreprocessor
(UserMessagePreprocessor userMessagePreprocessor) Assigns aUserMessagePreprocessor
that is used to prepare received user messages for display.
-
Constructor Details
-
Saml2AuthnRequestAuthenticationProviderConfigurer
public Saml2AuthnRequestAuthenticationProviderConfigurer()
-
-
Method Details
-
signatureValidator
public Saml2AuthnRequestAuthenticationProviderConfigurer signatureValidator(AuthnRequestValidator signatureValidator) Assigns a customAuthnRequestValidator
for validating the signatures ofAuthnRequest
messages.- Parameters:
signatureValidator
- a validator- Returns:
- this configurer
-
assertionConsumerServiceValidator
public Saml2AuthnRequestAuthenticationProviderConfigurer assertionConsumerServiceValidator(AuthnRequestValidator assertionConsumerServiceValidator) Assigns a custom assertion consumer serviceAuthnRequestValidator
.If the validation succeeds the validator must assigned the assertion consumer service URL using
Saml2AuthnRequestAuthenticationToken.setAssertionConsumerServiceUrl(String)
.- Parameters:
assertionConsumerServiceValidator
- the validator- Returns:
- this configurer
-
replayValidator
public Saml2AuthnRequestAuthenticationProviderConfigurer replayValidator(AuthnRequestValidator replayValidator) Assigns a replay validator. The default is to useAuthnRequestReplayValidator
with an in-memoryMessageReplayChecker
. UsemessageReplayChecker(MessageReplayChecker)
to configure anotherMessageReplayChecker
but stick with theAuthnRequestReplayValidator
.- Parameters:
replayValidator
- the validator- Returns:
- this configurer
-
messageReplayChecker
public Saml2AuthnRequestAuthenticationProviderConfigurer messageReplayChecker(MessageReplayChecker messageReplayChecker) Assigns aMessageReplayChecker
to theAuthnRequestReplayValidator
. Mutually exlcusive withreplayValidator(AuthnRequestValidator)
.- Parameters:
messageReplayChecker
- the message replay checker to use- Returns:
- this configurer
-
requestedAttributeProcessors
public Saml2AuthnRequestAuthenticationProviderConfigurer requestedAttributeProcessors(Consumer<List<RequestedAttributeProcessor>> customizer) Gives access to the list ofRequestedAttributeProcessor
s. Using this method the suppliedConsumer
may be used to add/remove or modify the processors.- Parameters:
customizer
- the customizer- Returns:
- this configurer
-
signatureMessageExtensionExtractor
public Saml2AuthnRequestAuthenticationProviderConfigurer signatureMessageExtensionExtractor(SignatureMessageExtensionExtractor signatureMessageExtensionExtractor) Assigns a customSignatureMessageExtensionExtractor
. The default isDefaultSignatureMessageExtensionExtractor
. It is possible to disable support for theSignMessage
extension by assigningnull
.- Parameters:
signatureMessageExtensionExtractor
- the custom extractor (ornull
)- Returns:
- this configurer
-
signatureMessagePreprocessor
public Saml2AuthnRequestAuthenticationProviderConfigurer signatureMessagePreprocessor(SignatureMessagePreprocessor signatureMessagePreprocessor) Assigns aSignatureMessagePreprocessor
that is used to prepare received sign messages for display. By default, no processor is installed.- Parameters:
signatureMessagePreprocessor
- the processor.- Returns:
- this configurer
-
userMessagePreprocessor
public Saml2AuthnRequestAuthenticationProviderConfigurer userMessagePreprocessor(UserMessagePreprocessor userMessagePreprocessor) Assigns aUserMessagePreprocessor
that is used to prepare received user messages for display. By default, no processor is installed.- Parameters:
userMessagePreprocessor
- the processor- Returns:
- the configurer
-
principalSelectionProcessor
public Saml2AuthnRequestAuthenticationProviderConfigurer principalSelectionProcessor(PrincipalSelectionProcessor principalSelectionProcessor) Assigns a customPrincipalSelectionProcessor
. The default isDefaultPrincipalSelectionProcessor
. It is possible to disable support for thePrincipalSelection
extension by assigningnull
.- Parameters:
principalSelectionProcessor
- the custom principal selection extractor (ornull
)- Returns:
- this configurer
-
nameIDGeneratorFactory
public Saml2AuthnRequestAuthenticationProviderConfigurer nameIDGeneratorFactory(NameIDGeneratorFactory nameIDGeneratorFactory) Assigns a customNameIDGeneratorFactory
. The default isDefaultNameIDGeneratorFactory
.- Parameters:
nameIDGeneratorFactory
- the custom NameID generator factory- Returns:
- this configurer
-
serviceProviderFilter
public Saml2AuthnRequestAuthenticationProviderConfigurer serviceProviderFilter(@Nonnull Saml2ServiceProviderFilter serviceProviderFilter) Assigns aSaml2ServiceProviderFilter
.- Parameters:
serviceProviderFilter
- the filter- Returns:
- this configurer
-
createDefaultRequestedAttributeProcessors
protected static List<RequestedAttributeProcessor> createDefaultRequestedAttributeProcessors(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) Gets the default set ofRequestedAttributeProcessor
s.- Parameters:
httpSecurity
- the HTTP security object- Returns:
- a list of
RequestedAttributeProcessor
s
-