Prerequisites
- SAML authentication must be configured on your Omni instance. See Authentication and Authorization for setup instructions.
omnictlmust be installed and configured with Admin access to your Omni instance.
How SAML label rules work
When a SAML user logs in to Omni, their SAML attributes are read and mapped to labels on the user resource. Omni recognises the following SAML attribute names by default and maps them to therole label key:
| SAML attribute | Provider |
|---|---|
http://schemas.microsoft.com/ws/2008/06/identity/claims/role | Microsoft |
Role | |
role | Samltest |
Role: engineers will be labeled saml.omni.sidero.dev/role/engineers in Omni automatically when using Google or a compatible provider.
If your SAML identity provider uses a different attribute name, you must configure Omni to map it to the role key. This can be done via the CLI flag when starting the Omni server:
SAMLLabelRule resource can automatically assign an Omni role when a matching label is found. If multiple rules match the same user, the role with the highest access level is assigned.
Create and verify a SAML label rule
The following example creates a rule that assigns theOperator role to any new SAML user whose SAML attributes include Role: engineers.
Step 1: Create the rule
Create and apply theSAMLLabelRule resource:
spec are:
| Field | Description |
|---|---|
assignrole | The Omni role to assign to matching users. Valid values are Reader, Operator, and Admin. |
updateoneachlogin | If true, the role is re-evaluated and updated on every login, not just the first. If false, the role is only assigned on the user’s first login. |
matchlabels | A list of SAML-derived labels to match against. Labels follow the format saml.omni.sidero.dev/<attribute-name>/<attribute-value>. |
Step 2: Verify the rule was applied
Log in to Omni as a SAML user with the matching attribute, then confirm the role was assigned by running the following command, replacing<user-email> with the user’s email address:
Limitations
The following limitations apply when automatically assigning roles to SAML users:- SAML label rules only apply to users logging in for the first time. If a user has already logged in to Omni at least once, their role will not be updated by a
SAMLLabelRuleand must be updated manually by an administrator. - If the SAML user is the first user to log in to an Omni instance, the
SAMLLabelRulewill not apply. The first user is always assigned theAdminrole, regardless of any label rules.