Interface AuthnRequestGeneratorContext
AuthnRequestGenerator.generateAuthnRequest(String, String, AuthnRequestGeneratorContext) creates an
authentication request.- Author:
- Martin Lindström (martin@idsec.se)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceWhen the generator is about to add theAssertionConsumerServiceURLorAssertionConsumerServiceIndexattribute it will invoke thegetAssertionConsumerServiceResolver()method in order to get a function that given all possibleAssertionConsumerServiceelements (found in the SP metadata) will either return aString(holding theAssertionConsumerServiceURLto use) or anInteger(holding theAssertionConsumerServiceIndexto use).static interfaceIf the SP metadata contains one or moreAttributeConsumingServiceelements, the generator needs to know whether to include theAttributeConsumingServiceIndexattribute, and if so, which index to use.static interfaceWhen the generator is done building theAuthnRequest, but before it is signed, it will ask thegetAuthnRequestCustomizer()method for the customizer that may operate and add customizations to the request object.static enumEnumeration that tells whether the Holder-of-key WebSSO profile is required, optional or not active.static interfaceANameIDPolicyBuilderFunctionis used by the generator to create theNameIDPolicyelement.static interfaceThe generator will need to know how to build theRequestedAuthnContextelement that is to be included in theAuthnRequest. -
Method Summary
Modifier and TypeMethodDescriptionGets theAuthnRequestGeneratorContext.AssertionConsumerServiceResolverto use for resolving whichAssertionConsumerServiceto use and whether to produce anAssertionConsumerServiceURLorAssertionConsumerServiceIndexattribute.Gets the resolver function for determining how to create theAttributeConsumingServiceIndexattribute.default BooleanGets theForceAuthnattribute value.Gets the SP requirement for using the Holder-of-key profile.default BooleanGets theIsPassiveattribute value.Gets the builder for creating aNameIDPolicyelement.default X509CredentialTheAuthnRequestGeneratoris normally configured with a signing credentialAuthnRequestGenerator.getSignCredential().default StringGets the binding to use when generating a request (redirect/POST).Gets the builder function for creating theRequestedAuthnContextelement to add to theAuthnRequest.default SignatureSigningConfigurationIf a signature configuration, other than the default (SecurityConfigurationSupport.getGlobalSignatureSigningConfiguration()) should be used to sign the request this method should return this configuration.
-
Method Details
-
getPreferredBinding
Gets the binding to use when generating a request (redirect/POST).This binding will be used in all cases except when the IdP does not support the binding.
The default implementation returns "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect".
- Returns:
- the preferred binding
-
getHokRequirement
Gets the SP requirement for using the Holder-of-key profile. The default is that the SP does not support HoK.- Returns:
- a HoK requirement
-
getForceAuthnAttribute
Gets theForceAuthnattribute value.The default implementation returns
true.If
nullis returned, theForceAuthnattribute will not be included.- Returns:
- the ForceAuthn attribute
-
getIsPassiveAttribute
Gets theIsPassiveattribute value.The default implementation returns
null.If
nullis returned, theIsPassiveattribute will not be included.- Returns:
- the IsPassive attribute
-
getSignatureSigningConfiguration
If a signature configuration, other than the default (SecurityConfigurationSupport.getGlobalSignatureSigningConfiguration()) should be used to sign the request this method should return this configuration.The default implementation returns
null.- Returns:
- the signature configuration, or null
-
getAssertionConsumerServiceResolver
default AuthnRequestGeneratorContext.AssertionConsumerServiceResolver getAssertionConsumerServiceResolver()Gets theAuthnRequestGeneratorContext.AssertionConsumerServiceResolverto use for resolving whichAssertionConsumerServiceto use and whether to produce anAssertionConsumerServiceURLorAssertionConsumerServiceIndexattribute.The default implementation will return a
AssertionConsumerServiceURLbased on (1)isDefaultattribute and (2) the lowestIndex.- Returns:
- a function for resolving AssertionConsumerService elements
-
getAttributeConsumingServiceIndexResolver
default AuthnRequestGeneratorContext.AttributeConsumingServiceIndexResolver getAttributeConsumingServiceIndexResolver()Gets the resolver function for determining how to create theAttributeConsumingServiceIndexattribute.The default implementation returns
null, meaning that no attribute is added.- Returns:
- a resolver function
-
getNameIDPolicyBuilderFunction
Gets the builder for creating aNameIDPolicyelement.The default implementation will use the first
NameIDFormatin the list and create aNameIDPolicyelement with this value as theFormatattribute and theAllowCreateset to true. If the supplied list is empty, the format will be set tourn:oasis:names:tc:SAML:1.1:nameid-format:unspecified.- Returns:
- a builder function
-
getRequestedAuthnContextBuilderFunction
default AuthnRequestGeneratorContext.RequestedAuthnContextBuilderFunction getRequestedAuthnContextBuilderFunction()Gets the builder function for creating theRequestedAuthnContextelement to add to theAuthnRequest.The default implementation will create a
RequestedAuthnContextobject with exact matching and all assurance certification URI:s included in the supplied list.- Returns:
- a function that returns a RequestedAuthnContext (or null).
-
getAuthnRequestCustomizer
Gets theAuthnRequestGeneratorContext.AuthnRequestCustomizer.The default implementation returns a NO-OP consumer, meaning no customizations are done.
- Returns:
- a consumer working on the AuthnRequest object being built
-
getOverrideSignCredential
TheAuthnRequestGeneratoris normally configured with a signing credentialAuthnRequestGenerator.getSignCredential(). This method exist so that we may override the default credential. Mainly for testing purposes.The default implementation returns
null.- Returns:
- the signing credential to use, or null if no override should be done
-