# Troubleshooting common SAML federation issues with Dynatrace SSO

**URL:** <https://community.dynatrace.com/t/troubleshooting-common-saml-federation-issues-with-dynatrace-sso/45279>\
**Category:** Troubleshooting\
**Tags:** saml, federation, sso\
**Created:** [April 24, 2024, 10:00pm UTC](https://community.dynatrace.com/t/troubleshooting-common-saml-federation-issues-with-dynatrace-sso/45279 "2024-04-24T22:00:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Waclaw\_Dziewuls](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/waclaw_dziewuls/32/17521_2.png) [@Waclaw\_Dziewuls](https://community.dynatrace.com/u/Waclaw_Dziewuls)\
**Post date:** [April 24, 2024, 10:00pm UTC](https://community.dynatrace.com/t/troubleshooting-common-saml-federation-issues-with-dynatrace-sso/45279/1 "2024-04-24T22:00:49Z")

</div>

# Overview

Dynatrace Single Sign-On supports SAML Federated Login for customers with its own set of requirements that the IdP has to meet to allow the users to access Dynatrace:&nbsp;[SAML — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/manage-users-groups-with-saml#identity-provider-idp). As SAML itself is a complex protocol, we are aware of some common pitfalls of the configuration process and we are providing a guide to explain, why they appear and how to successfully resolve them in two of the popular IdPs: Azure Entra ID and Okta.

# Common issues:

## _Saml Message has not been signed. Entire SAML Message needs to be signed._

 ![Screenshot 2024-04-24 at 16.28.01.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a3a963fe3b3a71e28b117ab4476d95684687f3ab.png)

This error indicates that there is either no signature in the SAML message or on the assertions were signed, not the whole SAML message. The whole message must be signed, because only then is the Service Provider confident that the message was not tampered with, hence our restriction.

It’s possible to notice the difference in SAML Responses between Signed Assertions and Signed Whole Messages e.g. captured and decoded by SAML Trace based on the placement of the ds:Signature&nbsp; as shown here:&nbsp;[Online Tools | OneLogin Developers](https://www.samltool.com/generic_sso_res.php)

In the example above, with **whole message signing** , the ds:Signature is before and top-level from the saml:Assertion:

```markup
<samlp:Response (...)>
  <saml:Issuer>http://idp.example.com/metadata.php</saml:Issuer>
    <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
      (...)
    </ds:Signature>
  (...)
  <saml:Assertion (...)>

```

Assertion signing will contain the ds:Signature entry under and within the saml:Assertion tag:

```markup
<samlp:Response (...)>
  <saml:Issuer>http://idp.example.com/metadata.php</saml:Issuer>
  (...)
  <saml:Assertion (...)>
     <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
      (...)
    </ds:Signature>
  </saml:Assertion>

```

Dynatrace SSO expects whole messages to be signed, which is the first one.

### Resolution:

#### Azure

Navigate to the Azure Entra ID, and then to the SAML Enterprise Application you configured for Dynatrace. Then please open “Manage” → “Single Sign-On” and choose “Edit” within the “SAML Certificates” section.

 ![Screenshot 2024-04-24 at 15.43.57.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/6/46588b9e1f8aa84cf86b491b86fb2a22a54905a4.png)

In the newly opened section, select the drop-down in “Signing option” and select: “Sign SAML Response”

 ![Screenshot 2024-04-24 at 15.44.15.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/6/96eedca5ba4c23b6902ef01b7aa925d1f9d6df6f.png)

#### Okta

Within the SAML Application configured for Dynatrace, choose the “General” tab and scroll down to the “SAML Settings” section and click “Edit”.

 ![Screenshot 2024-04-24 at 23.34.51.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/7/477ed3bd933d6db430708a27122c1f8d529e2a42.png)

Then click “Next” to get to the “Configure SAML section”.

 ![Screenshot 2024-04-24 at 23.38.00.png](https://global.discourse-cdn.com/dynatrace/original/2X/c/cf7182fa0b20359ab97dc6e6d3c22cdca6c794cc.png)

In the “SAML Settings” Section, scroll down and click “Show advanced settings” to see the signing options. The “Response” option should be set to “Signed”, which will set whole SAML Message signing.

 ![Screenshot 2024-04-24 at 23.32.36.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/2/72a2844da72101c30564be0062495a18ddef6196.png)

## _Invalid SAML Message. Missing NameID element with value._

## _SAML Message NameID Format {0} was incorrect. Allowed formats:&nbsp;urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress_

 ![Screenshot 2024-04-25 at 01.06.11.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/d/9d4e25a8d46962a9e04cfc3fa9dcfdd7d9a1d3c5.png)

Dynatrace SSO expects to find the user’s login in the SAMLResponse under the \<Subject\>\<NameID\> field and it has to be exactly set to have Format=“urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress”. Otherwise the SAML Response will be rejected. Some IdPs, such as Azure enforce this assertion by default, others have to be configured explicitly to add it.

```markup
<Subject>
    <NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">Your.UserName@yourdomain.com</NameID>
</Subject>

```

### Resolution:

#### Azure

Navigate to the Azure Entra ID, to the SAML Enterprise Application that you have configured for Dynatrace. Then please open “Manage” → “Single Sign-On” and choose “Edit” within the “Attributes & Claims” section.

 ![Screenshot 2024-04-24 at 15.43.57.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/6/46588b9e1f8aa84cf86b491b86fb2a22a54905a4.png)

Then, make sure there is a Unique User Identifier (Name ID) claim.

 ![Screenshot 2024-04-24 at 19.34.16.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/4/249f6e51014b7b6446093ee74d853c8374ab7c8f.png)

Upon clicking on the claim, check that the Name identifier format is set to Email Address.

 ![Screenshot 2024-04-24 at 19.36.27.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/7/17bcc92601e0e95baa8be4389567ec3caf8c2784.png)

#### Okta

Within the SAML Application configured for Dynatrace, choose the “General” tab and scroll down to the “SAML Settings” section and click “Edit”.

 ![Screenshot 2024-04-24 at 23.34.51.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/7/477ed3bd933d6db430708a27122c1f8d529e2a42.png)

Then click “Next” to get to the “Configure SAML section”.

 ![Screenshot 2024-04-24 at 23.38.00.png](https://global.discourse-cdn.com/dynatrace/original/2X/c/cf7182fa0b20359ab97dc6e6d3c22cdca6c794cc.png)

Please make sure the “Name ID format” is set to “EmailAddress”. The “Application username” should in most cases be set to “Email”, especially if you use a different login as the Okta Username.

 ![Screenshot 2024-04-24 at 23.58.59.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/8/38bba9d5d603b6d1f2bfd92acd85089b94dfebf2.png)

## _Y__our IdP returned different user {0} than user {1} you entered into Dynatrace._

 ![Screenshot 2024-04-24 at 19.29.55.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/4/24d86d01df4a30ea24021138b9db05a729125966.png)

The NameID claim (described above) is used in Dynatrace SSO to match the user login in the IdP to the one entered in the login field and they have to match.

### Resolution:

First and foremost, please verify that the user currently logged into Dynatrace or the one which you input in the login field in Dynatrace SSO match:

 ![Screenshot 2024-04-24 at 19.44.21.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/c/6cbcf066b4476325e1f84955744dcb9532f1c020.png)

 ![Screenshot 2024-04-25 at 00.44.50.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/5/25803591c5e3b24aca7ef0b04b0913b1f9b551e1.png)

 ![Screenshot 2024-04-25 at 00.46.35.png](https://global.discourse-cdn.com/dynatrace/original/3X/5/6/56ab912bb2d28986e64e512f629de78b44a90c64.png)

### Azure

On top of the settings from the paragraphs above about NameID, please make sure that the parameter you use for the Source attribute e.g. user.userprincipalname :

 ![Screenshot 2024-04-24 at 19.36.27.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/7/17bcc92601e0e95baa8be4389567ec3caf8c2784.png)

is actually the same as the value for the user currently attempting to log in:

 ![Screenshot 2024-04-24 at 19.41.29.png](https://global.discourse-cdn.com/dynatrace/original/2X/5/5b669d64e1011eeae26b140f84f688e9a323d53b.png)

### Okta

If you are using the “Application username” as “Email” in the “SAML Settings” (see how to reach these settings above), then within the user’s profile, please make sure the “Primary email” value is the same as was entered in the Dynatrace SSO login field.

 ![Screenshot 2024-04-24 at 23.58.59.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/8/38bba9d5d603b6d1f2bfd92acd85089b94dfebf2.png)

 ![Screenshot 2024-04-25 at 00.50.42.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/8/98e66cfb21fac29ef34a03a05c4b8c6463e2e818.png)
