SAML SSO providers
- Latest
- Version 1
βοΈ Configurationβ
Harmoney acts as a service provider using a Harmoney Provider.
Settings Configuration
Examples
π οΈ Technical documentationβ
SSO_RESULT_MAPPINGβ
Customers map their data in their own specific way. This requires us to make the mapping configurable.
Fieldsβ
fieldsMapping: Defines what claim should be used to map an SSO result field.- The SSO result fields to map are:
uidfirstName(TriState)lastName(TriState)mobilePhone(TriState)email(TriState)languageIsoCode(TriState)gender(TriState)roles(In combination with the SSO_ROLE_MAPPING setting)
- For each TriState field mapping, you can specify the tristate behavior with the
setUndefinedIfNullflag (defaultfalse).true: Donβt update field if value is not provided in claims.false: Remove current value if claim is null.
- Note: There is one special field
prefixthat is used by certain customers to get a custom value into the mobile phone field to allow automatic registration. This should be avoided as it might break in future updates.
- The SSO result fields to map are:
usePrefillFields: When the SSO provider is used to start the flow, we have some prefilled user data in our own token that can be used in the SSO result. This behavior can be configured with this flag.- Note: Will throw an exception if configured
truebut no registration prefill is available in the token. - The fields that can be prefilled are
firstName,lastName,genderandlanguageIsoCode.
- Note: Will throw an exception if configured
fallbackRoles: A list of String values that correspond to the keys configured in theSSO_ROLE_MAPPING. If a field mapping for the "roles" is configured BUT the claims donβt contain a value for this mapping, then we fall back on this value list to map the user roles.initialRole: A single Role value. If configured, this defines the role that will be active when the user starts their session.
Note on automatic registration: In order to register with SSO without being redirected to the registration form, the
firstName,lastNameandmobilePhonefields MUST have a value. Take this into account when configuring the fields mapping if you want automatic registration!
Example:
{
"SSO_RESULT_MAPPING": {
"fieldsMapping": {
"email": {
"fieldName": "email",
"setUndefinedIfNull": true
},
"firstName": {
"fieldName": "given_name"
},
"gender": {
"fieldName": "gender"
},
"languageIsoCode": {
"fieldName": "language"
},
"lastName": {
"fieldName": "family_name"
},
"mobilePhone": {
"fieldName": "telephone"
},
"roles": {
"fieldName": "groups"
},
"uid": {
"fieldName": "sub"
}
},
"fallbackRoles": [
"agent"
]
}
}
SSO_ROLE_MAPPINGβ
The fspExtRef is used to define which Financial Service Provider (FSP) the role applies to, using the reference of the FSP itself.
If no fspExtRef is defined, the FSP is retrieved from the following attribute:
.../claims/physicalDeliveryOfficeName
Warning: This fallback method resolves the FSP by searching for references on the link between a parent FSP and a child FSP (agency).
The idp_role key can be any string.
Example:
{
"idp_role": [
{
"role": "PARTNER_ADVISOR",
"fspExtRef": "__FSP_REF__"
}
]
}
Encryptionβ
When the Identity Provider (IdP, e.g., Azure AD) sends a SAML response to the Service Provider (SP, Harmoney), the response can be encrypted for enhanced security.
The IdP encrypts the SAML response using a public certificate provided by Harmoney. Once received, Harmoney decrypts the response using the corresponding private key.
Creation of a Certificate & Private Keyβ
You can generate the required keys using OpenSSL.
- Create a private key:
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem
- Create public certificate (define the expiration days, because the default is 30 days!)
openssl req -new -x509 -key private-key.pem -out certificate.pem -days 365
Examplesβ
- Encrypted
- Unencrypted
The EncryptedAssertion contains 2 encrypted parts:
- Encrypted key: contains a symmetric key which can be used to decrypt the Encrypted Data.
- Encrypted data : contains the
Assertion
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_____ID_____" Version="2.0" IssueInstant="2023-07-17T01:01:48Z"
Destination="https://sp.harmoney.eu/saml" InResponseTo="_____REQUEST_ID_____">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://idp.example.com/metadata</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:EncryptedAssertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_____ASSERTION_ID_____">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xenc:EncryptedKey>
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<xenc:CipherData>
<xenc:CipherValue>_____ENCRYPTED_SYMMETRIC_KEY_____</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedKey>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>_____ENCRYPTED_DATA_____</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</saml:EncryptedAssertion>
</samlp:Response>
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_____ID_____" Version="2.0" IssueInstant="2023-03-21T09:09:51.626Z"
Destination="https://sp.harmoney.eu/saml" InResponseTo="_____REQUEST_ID_____">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://idp.example.com/metadata/</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_____ASSERTION_ID_____" Version="2.0" IssueInstant="2023-03-21T09:09:51.620Z">
<saml:Issuer>https://idp.example.com/metadata/</saml:Issuer>
<saml:Signature xmlns:saml="http://www.w3.org/2000/09/xmldsig#">...</saml:Signature>
<saml:Subject>...</saml:Subject>
<saml:Conditions NotBefore="2023-03-21T09:04:51.484Z" NotOnOrAfter="2023-03-21T10:09:51.484Z"></saml:Conditions>
<saml:AttributeStatement>
<saml:Attribute Name="http://schemas.microsoft.com/identity/claims/tenantid">
<saml:AttributeValue>aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="http://schemas.microsoft.com/identity/claims/objectidentifier">
<saml:AttributeValue>10000000-2000-3000-4000-500000000000</saml:AttributeValue>
</saml:Attribute>
...
</saml:AttributeStatement>
...
</saml:Assertion>
</samlp:Response>
π Referencesβ
- http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html
- https://www.oasis-open.org/committees/download.php/27819/sstc-saml-tech-overview-2.0-cd-02.pdf
- https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
- https://help.ivanti.com/mi/help/en_us/ACC/50/gd/AccessGuide/Encryption%20certificates.htm
- https://docs.netscaler.com/en-us/citrix-adc/current-release/aaa-tm/authentication-methods/saml-authentication.html
βοΈ Configurationβ
Harmoney acts as a service provider using a Harmoney Provider
Provider fieldsβ
Below an overview of how a SAML SSO Provider will use some of the provider fields.
| Mandatory | ||
|---|---|---|
| Identifier | β | β οΈ This identifier is used in the callback-url, so please use only alphabetical characters or dashes β οΈ This identifier is also used as a prefix for the mobilePhoneNumber |
| Client ID | β | The ID of the Issuer (needs to match the configuration on IDP side), also referred to as Entity ID |
| Client secret | β | Contains the private key (RSA) used for decrypting SAML assertions (only applicable when encryption is enabled, see Encryption). |
| Authorize URI | β | The URI of the SAML Identity Provider where the user will be navigated to log in. Example: https://login.example.com/id/saml2 |
| Redirect path | β | The Reply URL where the SAML response is sent to (also referred to as Assertion Consumer Service URL). Example: https://redirect.customer.myharmoney.eu/saml2-xxx |
Settingsβ
Additional to the base [SSO Provider configuration](sso-providers.md#βοΈ Configuration), extra settings are available:
| Key | Mandatory | |
|---|---|---|
SSO_X509_CERTIFICATE | β | This certificate can be used to decrypt an encrypted SAML response. X.509 Certificate. Only applicable when encryption is enabled |
digitalSignatureValidation | β | Enables the validation of the signature of the assertion in the SAML response. |
idpSsoProviderSigningKey | β | When used, this key can be used to validates the signature of the assertion in the SAML response. Optional, because the key is also included in the SAML response itself |
metadataUrl | β | The URL where the Identity Provider Metadata XML can be found. This XML contains certificate keys to validate the signature of the assertion in the SAML response. Optional, because the key is also included in the SAML response itself |
π οΈ Technical documentationβ
SAML response mappingβ
- First Name:
claims/givenname - Last Name:
claims/surname - Email:
claims/emailaddress - Mobile nr:
claims/mobilephone - Role:
claims/role - In combination with SSO_ROLE_MAPPING setting
- Language:
LanguageIsoCode - Fallback on default WL language when not provided
Encryptionβ
When the (SAML) Identity Provider (e.g. Azure AD) sends a response to the Service Provider (Harmoney), it is possible to encrypt the response. The SAML response can be encrypted by the IdP using a (public) certificate provided by Harmoney (SP). Harmoney can then decrypt the SAML response using a combination of the certificate and a private key.
Creation of a certificate & private key:
- Create private key
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private-key.pem - Create public certificate (define the expiration days, because the default is 30 days!)
openssl req -new -x509 -key private-key.pem -out certificate.pem -days 365
Examplesβ
- Encrypted
- Unencrypted
The EncryptedAssertion contains 2 encrypted parts:
- Encrypted key: contains a symmetric key which can be used to decrypt the Encrypted Data.
- Encrypted data : contains the
Assertion
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_____ID_____" Version="2.0" IssueInstant="2023-07-17T01:01:48Z"
Destination="https://sp.harmoney.eu/saml" InResponseTo="_____REQUEST_ID_____">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://idp.example.com/metadata</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:EncryptedAssertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_____ASSERTION_ID_____">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xenc:EncryptedKey>
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
<xenc:CipherData>
<xenc:CipherValue>_____ENCRYPTED_SYMMETRIC_KEY_____</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedKey>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>_____ENCRYPTED_DATA_____</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</saml:EncryptedAssertion>
</samlp:Response>
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_____ID_____" Version="2.0" IssueInstant="2023-03-21T09:09:51.626Z"
Destination="https://sp.harmoney.eu/saml" InResponseTo="_____REQUEST_ID_____">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://idp.example.com/metadata/</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_____ASSERTION_ID_____" Version="2.0" IssueInstant="2023-03-21T09:09:51.620Z">
<saml:Issuer>https://idp.example.com/metadata/</saml:Issuer>
<saml:Signature xmlns:saml="http://www.w3.org/2000/09/xmldsig#">...</saml:Signature>
<saml:Subject>...</saml:Subject>
<saml:Conditions NotBefore="2023-03-21T09:04:51.484Z" NotOnOrAfter="2023-03-21T10:09:51.484Z"></saml:Conditions>
<saml:AttributeStatement>
<saml:Attribute Name="http://schemas.microsoft.com/identity/claims/tenantid">
<saml:AttributeValue>aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="http://schemas.microsoft.com/identity/claims/objectidentifier">
<saml:AttributeValue>10000000-2000-3000-4000-500000000000</saml:AttributeValue>
</saml:Attribute>
...
</saml:AttributeStatement>
...
</saml:Assertion>
</samlp:Response>
π Referencesβ
- http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html
- https://www.oasis-open.org/committees/download.php/27819/sstc-saml-tech-overview-2.0-cd-02.pdf
- https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf
- https://help.ivanti.com/mi/help/en_us/ACC/50/gd/AccessGuide/Encryption%20certificates.htm
- https://docs.netscaler.com/en-us/citrix-adc/current-release/aaa-tm/authentication-methods/saml-authentication.html