docs/sources/setup-grafana/configure-access/configure-authentication/saml/configure-saml-with-entraid/_index.md
Grafana supports user authentication through Microsoft Entra ID.
{{< admonition type="note" >}}
Starting in Grafana v11.2, the SAML integration offers a mechanism to retrieve user groups from the Graph API.
Grafana versions 11.1 and below do not support fetching groups from the Graph API endpoint. As a result, users with more than 150 groups will not be able to retrieve their groups. Instead, use the Entra ID connector.
Related links:
{{< /admonition >}}
Ensure you have permission to administer SAML authentication. For more information about roles and permissions in Grafana, refer to Roles and permissions.
If you have users that belong to more than 150 groups, configure a registered application to provide an Entra ID Graph API to retrieve the groups. Refer to Setup Entra ID Graph API applications.
Entra ID requires a certificate to verify the SAML requests' signature. You can generate a private key and a self-signed certificate using the following command (the private key used to sign the requests and the certificate contains the public key for verification):
$ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
This will generate a key.pem and cert.pem file that you can use for the private_key_path and certificate_path configuration options.
In order to validate Entra ID users with Grafana, you need to configure the SAML Toolkit application endpoints by creating a new SAML integration in the Entra ID organization.
For the following configuration, we will use
https://localhostas the Grafana URL. Replace it with your Grafana URL.
https://localhost/saml/metadata.https://localhost/saml/acs.https://localhost.https://localhost.https://localhost/saml/slo.idp_metadata_url field in the custom.ini file.client_secret field in the SAML configuration.In order to verify the logged in user is the same user that was provisioned through Entra ID, you need to include the same externalId in the SAML assertion by mapping the SAML assertion assertion_attribute_external_id.
Attributes & Claims section.userUIDuser.objectIdIf the default URI claims don't work, adjust your user mapping to the following:
While you can configure an Entra ID tenant in Grafana via SAML, some additional information is only accessible via the Graph API. To retrieve this information, create a new application in Entra ID and grant it the necessary permissions. To learn more refer to Entra ID SAML limitations.
The following configuration example uses the URL https://localhost as the Grafana URL. Replace it with your Grafana instance URL.
This app registration is used as a Service Account to retrieve more information about the Entra ID user.
https://localhost/login/azuread.<directory-name>.The following table shows what the permissions look like from the Entra ID portal:
| Permissions name | Type | Admin consent required | Status |
|---|---|---|---|
GroupMember.Read.All | Application | Yes | Granted |
User.Read | Delegated | No | Granted |
User.Read.All | Application | Yes | Granted |
{{< figure src="/media/docs/IAM/image.png" caption="Screen shot of the permissions listed in Entra ID for the App registration" >}}
To test that Graph API has the correct permissions, refer to the Troubleshoot Graph API calls section.