Idira Identity: How can an Administrator filter Active Directory groups for a SAML application to only show a specific group in the attribute?

Idira Identity: How can an Administrator filter Active Directory groups for a SAML application to only show a specific group in the attribute?

89
Created On 11/10/26 10:54 AM - Last Modified 11/10/26 12:56 PM


Objective


How can an Administrator filter Active Directory groups for a SAML application to only show a specific group in the attribute?

Procedure


There are two options.
Option 1 (Suitable if there is only one word need to be included in filter):
When creating a custom SAML application, an Administrator can filter the results for groups that are returned when using the setFilteredAttributeArray attribute.

Use a Regex expression as outlined here:  https://technet.microsoft.com/en-us/library/hh440535(v=sc.12).aspx
(Link provided as a courtesy and subject to change)

Example: 

In order to have a SAML assertion return the Active Directory group value "ExampleSecurityGroup" in an attribute, an Administrator would add the following value to the Advanced section of the SAML application.

setFilteredAttributeArray('Groups', LoginUser.GroupNames, "ExampleSecurityGroup");

If the user is a member of this Security Group that contains this name, then the value 'ExampleSecurityGroup' will be passed in the assertion as an attribute value called "Groups".

To match the EXACT value for "ExampleSecurityGroup" use the following Regex expression:

setFilteredAttributeArray('Groups', LoginUser.GroupNames, "^ExampleSecurityGroup$"); 

Note:  If the value is NOT present, a null value is passed in the Assertion for the 'Groups' variable


Option 2 (Suitable for all situations):
Using a if case with the function indexOf() to filter the groups name

Example: 

In order to have a SAML assertion return the Active Directory group value "ExampleSecurityGroup" or "SecondSecurityGroup"  in an attribute, an Administrator would add the following script to the Advanced section of the SAML application.

var GroupNames = LoginUser.GroupNames;
var attrArray = new Array();
for (var i=0; i < GroupNames.Length; i++) {
if(GroupNames[i].indexOf("ExampleSecurityGroup")>= 0||GroupNames[i].indexOf("SecondSecurityGroup")>= 0){
trace(GroupNames[i]);
attrArray.push(GroupNames[i]);
}
}
setAttributeArray('Groups', attrArray);


Additional Information


Details


Question: 

How can an Administrator filter Active Directory groups for a SAML application to only show a specific group in the attribute?



Answer:

When creating a custom SAML application, an Administrator can filter the results for groups that are returned when using the setFilteredAttributeArray attribute.

Use a Regex expression as outlined here:  https://technet.microsoft.com/en-us/library/hh440535(v=sc.12).aspx
(Link provided as a courtesy and subject to change)



Example: 

In order to have a SAML assertion return the Active Directory group value "ExampleSecurityGroup" in an attribute, an Administrator would add the following value to the Advanced section of the SAML application.

setFilteredAttributeArray('Groups', LoginUser.GroupNames, "ExampleSecurityGroup");

If the user is a member of this Security Group that contains this name, then the value 'ExampleSecurityGroup' will be passed in the assertion as an attribute value called "Groups".

To match the EXACT value for "ExampleSecurityGroup" use the following Regex expression:

setFilteredAttributeArray('Groups', LoginUser.GroupNames, "^ExampleSecurityGroup$"); 

Note:  If the value is NOT present, a null value is passed in the Assertion for the 'Groups' variable


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj00000013blCAA&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail