Common aspects of SAML 2.0 AuthStates
The following SAML 2.0 AuthStates use OpenSAML 2.0 and have a common code base:
These AuthStates have several common properties, which are described in the following chapters.
Configuration of input and output bindings
in.binding, out.binding
SAML 2.0 bindings can be configured separately for input and output and for each type of a SAML message. The following example states that a response may be received in HTTP POST binding only, LogoutRequests may be received in any supported input binding, and all other message types must be received in HTTP redirect binding. All outgoing messages will use HTTP POST, except for LogoutResponse, which will use the same binding as the request message that initiated it.
<property name="in.binding"
value="Response:http-post LogoutRequest:auto http-redirect" />
<property name="out.binding" value="http-post LogoutResponse:auto" />
Bindings
The following bindings may be configured:
-
http-postThe HTTP POST binding as defined by the SAML 2.0 specification. This binding is supported for input and output bindings.
-
http-redirectThe HTTP redirect binding as defined by the SAML 2.0 specification. This binding is supported for input and output bindings.
-
http-artifactThe HTTP artifact binding in URL encoding as defined by the SAML 2.0 specification.
-
http-artifact-formThe HTTP artifact binding in POST encoding as defined by the SAML 2.0 specification.
-
internalThis pseudo-binding is used to issue and consume SAML messages without consideration of a specific transport mechanism. The SAML messages are consumed from the property
in.internalBindingSourceand output is placed to an OutArg variable with the name of the message type, prefixed withsaml.(e.g.,saml.SAMLResponse,saml.SAMLRequest) -
internal-assertionSame as internal binding, but issues and consumes assertions instead of responses. This may be used to handle assertions used in XML protocols such as WS-Security and WS-Federation.
-
http-post-deferred,http-redirect-deferred,http-artifact-deferred,http-artifact-form-deferredThese bindings prepare a HTTP POST, HTTP redirect or a HTTP artifact binding, respectively. However, instead of triggering the transfer, the generated OutArgs are prefixed with
nevis.deferred-transferinstead ofnevis.transfer, so that the SAML binding is not executed. -
autoThis may be set to accept all input bindings and to send out responses with the same binding as the initiating requests.
-
noneConfiguring this value disables input or output handling for the corresponding message types, for example to have an AuthState ignore incoming and previously consumed SAML messages or to make sure that no outgoing messages are ever generated.
Artifact resolution
In case of the artifact binding, the SAML message is transmitted from one party to another in two steps: In the first step, a reference to the SAML message, a so-called artifact, is transmitted from party A to party B. In the second step, party B uses the information from the artifact to request the actual SAML message through a web service at party A.
This binding requires that the SAML message issuer caches the message until it is fetched from the other party (or until it expires). nevisAuth uses the Out Of Context Data Service to store the message temporarily (see chapter"Shared out-of-context data for more information) and the artifact resolution web service (see chapter SAML artifact resolution service for how to set it up) to allow to fetch the actual SAML message. The following properties must be configured to allow artifact resolution as a server or as a client:
As a server:
out.bindinghttp-artifactorhttp-artifact-formout.artifactSourceId(optional)
As a client:
in.bindinghttp-artifactorhttp-artifact-form(or alternatively leave it atauto)in.artifact_sources
See chapter ServiceProviderState for details on the properties.
TheIdentity Provider and the Service Provider can both be server or client.
Signatures and signature validation
in.verify, out.sign
To configure which SAML constructs should be signed and for which constructs valid signatures shall be required, list the message types in the properties in.verify and out.sign. In the following example, Assertions and ArtifactResponses must contain valid signatures to be consumed, and outgoing Responses, Assertions and AuthnRequests will be signed:
<property name="in.verify" value="Assertion ArtifactResponse" />
<property name="out.sign" value="Response Assertion AuthnRequest" />
out.sign.hashAlgorithm
This parameter can be used to select a hash algorithm different from the default. The default hash algorithm used for SAML signatures in nevisAuth is SHA256. nevisAuth supports: SHA1, SHA256, SHA384, and SHA512.
in.keystoreref, in.keyobjectref, out.keystore, out.keystoreref
The credentials used for signature verification and for signing are configured using references to a keystore and a keyobject. For verification, in.keyobjectref may be omitted if all credentials in the keystore are valid signers. The signer credential will then be searched among all keyobjects of the keystore. This mechanism can detect the correct credential by SKI, IssuerSerial or by direct match of a certificate embedded into the signature.
in.map_issuer_certificate
In some cases, multiple federation partners are trusted. To make sure that no issuer can pose as another, this property may be activated. If this is the case, the ID of the keyobject used for verification must be identical to the issuer of the consumed message.
out.signatureKeyInfo
The KeyInfo embedded into a signature informs a validator about the signer credential used. If only one credential is used by both the signer and the validator, no KeyInfo is necessary. The KeyInfo to add to a signature is configured with the property out.signatureKeyInfo with one or several elements of the following list:
SKI, Certificate, CertificateChain, Subject, IssuerSerial, CRLs, SubjectDNAsKeyName, SubjectCNAsKeyName, KeyNames, EntityID, PublicKey
The list is whitespace-/comma-separated and case-insensitive. The default value is SKI. Note that only configured fields defined in the signer certificate are actually added to a KeyInfo structure.
Installing multiple certificates to support certificate roll-over
When certificates expire, they need to be replaced with new, valid certificates. This process is called certificate roll-over. In case of automatic certificate roll-over, the system will use the first valid certificate in the keystore for signature verification. Certificate roll-over scenarios are supported in the nevisAuth configuration.
For implementing roll-over scenarios we recommend using Java keystores as certificate store. In the SAML AuthStates we recommend setting the in.map_issuer_certificate property to true.
Example
Suppose the following is the KeyStore configuration for a SAML AuthState:
<KeyStore name="IDPTrustStore">
<KeyObject name="https://my.issuer.ch/saml" certificate="/var/opt/certs/my-issuer-ch.jks" / >
</KeyStore>
Then nevisAuth will perform automatic roll-over, if
- the AuthState is configured to use this keystore for signature verification (
in.keystorerefis set to "IDPTrustStore"), in.map_issuer_certificateis set to true,- and a SAML message with issuer
https://my.issuer.ch/samlis processed by the AuthState,
Thus, in terms of integration tasks for implementing certificate roll-over, all that is required is to add the new certificate to the appropriate store before the expiration date of the current one.