docs/sources/setup-grafana/configure-access/configure-authentication/saml/saml-ui/_index.md
{{< admonition type="note" >}} Available in Grafana Enterprise version 10.0 and later, and to customers on select Grafana Cloud plans. For pricing information, visit Pricing or contact our sales team. {{< /admonition >}}
You can configure SAML authentication in Grafana using the configuration file, Terraform, the API, or the UI. Refer to Set up options for SAML authentication in Grafana for more details. Configuration in the API or UI takes precedence over the configuration in the Grafana configuration file. For more information on how Grafana determines the order of precedence for its settings, refer to the SSO Settings API.
The Grafana SAML UI provides the following advantages over configuring SAML in the Grafana configuration file:
To configure SAML authentication from the UI, sign in to Grafana and navigate to Administration > Authentication > Configure SAML and follow this document.
To follow this guide, you need:
settings:read and settings:write with scope settings:auth.saml:* that allow you to read and update SAML authentication settings, which are granted by fixed:authentication.config:writer role. By default, this role is granted to Grafana server administrator in self-hosted instances and to Organization admins in Grafana Cloud instances.Complete the General settings fields:
Toggle Sign requests to specify whether you want the outgoing requests to be signed. Although optional, requesting signatures provides a more secure approach to SAML.
If you select to sign them:
Provide a certificate and a private key that'll be used by the service provider (Grafana) and the SAML IdP.
Use the PKCS #8 format to issue the private key.
For more information, refer to an example on how to generate SAML credentials.
Alternatively, you can generate a new private key and certificate pair directly from the UI. Click the Generate key and certificate button to open a form where you provide information to embed in the new certificate.
Choose which signature algorithm to use. The SAML standard recommends using a digital signature for some types of messages, like authentication or logout requests to avoid man-in-the-middle attacks.
{{< admonition type="note" >}} You can skip this screen. {{< /admonition >}}
Configure IdP using Grafana metadata:
Finish configuring Grafana using IdP data:
If you want to map user information from SAML assertions, complete the Assertion attributes mappings section.
If you want to automatically assign users' roles based on their SAML roles, complete the Role mapping section.
First, you need to configure the Role attribute field to specify which SAML attribute should be used to retrieve SAML role information. Then enter the SAML roles that you want to map to Grafana roles in Role mapping section. If you want to map multiple SAML roles to a Grafana role, separate them by a comma and a space. For example, Editor: editor, developer.
Role mapping automatically updates user's basic role based on their SAML roles every time the user logs in to Grafana. Learn more about SAML role synchronization.
If you're using Entra ID as the Identity Provider over SAML, keep in mind Azure's interpretation of these attributes. Enter the full URLs in the corresponding fields within the UI, which should match the URLs from the metadata XML. There are differences depending on whether it's a Role or Group claim vs other assertions which Microsoft has documented.
Group and Role:
http://schemas.microsoft.com/ws/2008/06/identity/claims/role
http://schemas.microsoft.com/ws/2008/06/identity/claims/groups
http://schemas.microsoft.com/identity/claims/displayname
Other assertions:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
If you're setting up Grafana with Entra ID using the SAML protocol and want to fetch user groups from the Graph API, complete the Entra ID Service Account Configuration subsection.
If you have multiple organizations and want to automatically add users to organizations, complete the Org mapping section.
First, you need to configure the Org attribute field to specify which SAML attribute should be used to retrieve SAML organization information.
Now fill in the Org mapping field with mappings from SAML organization to Grafana organization. For example, Org mapping: Engineering:2, Sales:2 will map users who belong to Engineering or Sales organizations in SAML to Grafana organization with ID 2.
If you want users to have different roles in different organizations, you can additionally specify a role. For example, Org mapping: Engineering:2:Editor will map users who belong to Engineering organizations in SAML to Grafana organization with ID 2 and assign them Editor role.
Organization mapping automatically updates user's organization memberships (and roles, if they've been configured) based on their SAML organization every time the user logs in to Grafana. Learn more about SAML organization mapping.
If you want to limit the access to Grafana based on user's SAML organization membership, fill in the Allowed organizations field.
Save and apply on the top right corner once you are done.Enabled. Your SAML configuration is now enabled.Disable in the top right corner.