Send a SAML Attribute Based on an AppUser Attribute Using the Group Attribute Type in Okta
Last Updated:
Overview
Sending Secure Assertion Markup Language (SAML) attributes using a custom AppUser attribute with the Group attribute type prevents violating the Attribute Statement Character Limit. This method allows the Value field to be populated with a variable referencing the application profile, while the actual mapped value is populated at the group level without relying on the Okta User Profile.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Secure Assertion Markup Language (SAML) 2.0
Solution
How is a SAML attribute sent using a custom AppUser attribute with a Group attribute type?
Create a custom application user attribute, configure the SAML settings to reference the new attribute, and assign the desired value to a group.
- Navigate to Directory > Profile Editor > Users, and select the application name.
- Select + Add Attribute.
- Select the desired Data type. The string data type is for one value, while the string array is for multiple values.
- Enter the desired Display name and Variable name.
- ((Optional) Select Define enumerated list of values to allow the selection of pre-populated attributes. Without this option, the attribute must be populated manually.
- Set the attribute type to Group.
- Navigate to the application General tab, and select SAML Settings > Edit > Next (General Settings) > SAML Settings > Show Advanced Settings.
- Add an attribute statement. In this example,
roleis the attribute name sent in the SAML Response, andappuser.roleis the variable sent for the attribute value based on the configuration in the subsequent steps. Theappuservariable references the application user profile for this specific application, androlereferences the custom attribute created in the previous steps. - Navigate to the Assignments tab, and assign a group by selecting Assign > Assign to Groups. Search for the desired group, and select Assign.
- Enter the desired value to be sent as the attribute value for the group.
- Test the login and check the SAML Response to ensure Okta sends the expected attribute name and attribute value.
<saml2:Attribute Name="role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified" > <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string" >Admin</saml2:AttributeValue>
