What is SAML assertion encryption?

What is SAML assertion encryption?

The SAML assertions are encrypted such that the assertions can be decrypted only with the private keys held by the service provider. Note The Following: Encryption of SAML assertions is disabled by default. Responses can be signed while carrying a signed encrypted Assertion, but the Response itself is not encrypted.

What is included in a SAML assertion?

A SAML assertion is the message that tells a service provider that a user is signed in. SAML assertions contain all the information necessary for a service provider to confirm user identity, including the source of the assertion, the time it was issued, and the conditions that make the assertion valid.

What is SAML assertion consumer endpoint?

The assertion consumer service (ACS) endpoint is a location to which the SSO tokens are sent, according to partner requirements. ACS is applicable to all SAML versions and both the IdP- and SP-initiated SSO profiles.

Are SAML requests signed?

X. 509 Certificate – A certificate provided by the IdP, used to verify the public key as passed by the IdP in the metadata of the SAML assertion. It allows the SP to verify the SAML assertion is actually coming from the IdP it trusts. SAML assertions are usually signed, however SAML requests can also be signed.

How does the service provider encrypt the SAML Assertion?

The service provider supplies their encryption public key to the identity provider. The identity provider encrypts the SAML assertion with the service provider’s public key. Only the custodian of the corresponding private key (ie the service provider) can decrypt the SAML assertion.

What do you need to know about SAML assertions?

Regardless of whether or not the SAML assertion is encrypted, the identity provider should sign either the SAML assertion or the SAML response that envelopes the SAML assertion. The identity provider signs the SAML assertion or response using its own private key.

How to create an encrypted SAML Response XML?

// Please make sure the file is in the root directory. X509Certificate2 encryptingCert = new X509Certificate2 (Path.Combine (HttpRuntime.AppDomainAppPath, “EncryptionX509Certificate.cer” ), “password” ); // Create an encrypted SAML assertion from the SAML assertion we have created.

How to read the encrypted SAML response from the IDP?

To read the encrypted SAML response from the IdP on the Service Provider website, you need to decrypt it and convert to an Assertion object. The following code demonstrates how to do so: