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
Constructors -
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 ofRequestedAttributeProcessors.messageReplayChecker(MessageReplayChecker messageReplayChecker) Assigns aMessageReplayCheckerto 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 ofRequestedAttributeProcessors.serviceProviderFilter(Saml2ServiceProviderFilter serviceProviderFilter) Assigns aSaml2ServiceProviderFilter.signatureMessageExtensionExtractor(SignatureMessageExtensionExtractor signatureMessageExtensionExtractor) Assigns a customSignatureMessageExtensionExtractor.signatureMessagePreprocessor(SignatureMessagePreprocessor signatureMessagePreprocessor) Assigns aSignatureMessagePreprocessorthat is used to prepare received sign messages for display.signatureValidator(AuthnRequestValidator signatureValidator) Assigns a customAuthnRequestValidatorfor validating the signatures ofAuthnRequestmessages.userMessagePreprocessor(UserMessagePreprocessor userMessagePreprocessor) Assigns aUserMessagePreprocessorthat is used to prepare received user messages for display.
-
Constructor Details
-
Saml2AuthnRequestAuthenticationProviderConfigurer
public Saml2AuthnRequestAuthenticationProviderConfigurer()
-
-
Method Details
-
signatureValidator
public Saml2AuthnRequestAuthenticationProviderConfigurer signatureValidator(AuthnRequestValidator signatureValidator) Assigns a customAuthnRequestValidatorfor validating the signatures ofAuthnRequestmessages.- 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 useAuthnRequestReplayValidatorwith an in-memoryMessageReplayChecker. UsemessageReplayChecker(MessageReplayChecker)to configure anotherMessageReplayCheckerbut stick with theAuthnRequestReplayValidator.- Parameters:
replayValidator- the validator- Returns:
- this configurer
-
messageReplayChecker
public Saml2AuthnRequestAuthenticationProviderConfigurer messageReplayChecker(MessageReplayChecker messageReplayChecker) Assigns aMessageReplayCheckerto 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 ofRequestedAttributeProcessors. Using this method the suppliedConsumermay 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 theSignMessageextension by assigningnull.- Parameters:
signatureMessageExtensionExtractor- the custom extractor (ornull)- Returns:
- this configurer
-
signatureMessagePreprocessor
public Saml2AuthnRequestAuthenticationProviderConfigurer signatureMessagePreprocessor(SignatureMessagePreprocessor signatureMessagePreprocessor) Assigns aSignatureMessagePreprocessorthat 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 aUserMessagePreprocessorthat 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 thePrincipalSelectionextension 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 ofRequestedAttributeProcessors.- Parameters:
httpSecurity- the HTTP security object- Returns:
- a list of
RequestedAttributeProcessors
-