<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00006uRHIdCAOOkta Classic EngineAdministrationAnswered2024-04-18T09:27:29.000Z2021-04-08T23:32:03.000Z2021-09-14T23:36:31.000Z

4znjl (4znjl) asked a question.

Trouble retrieving Active Directory groups in OpenID Connect claims

I'm having trouble getting AD groups from OIDC claims.

I did the following tests based on the information here:

https://support.okta.com/help/s/article/Can-we-retrieve-both-Active-Directory-and-Okta-groups-in-OpenID-Connect-claims

 

In the Okta OpenID Connect app, I tried setting the Groups claim expression to:

`Arrays.flatten(Groups.startsWith("OKTA","",100))` - returns all Okta groups

`Arrays.flatten(Groups.startsWith("OKTA","",50))` - returns all Okta groups

`Arrays.flatten(Groups.startsWith("OKTA","",5))` - returns no claims with error "The 'groups' user claim could not be evaluated" (??)

 

In Okta Admin, if I go Directory > Profile Editor > Directories tab, the single profile has a variable of `active_directory`, so I tried:

`Arrays.isEmpty(Arrays.toCsvString(Groups.startsWith("active_directory","",100))) ? Groups.startsWith("OKTA","",100) : Arrays.flatten(Groups.startsWith("OKTA","",100),Groups.startsWith("active_directory","",100))`

 

And got empty claims with error:

"

The error message returned is:

=The 'groups' user claim could not be evaluated.

"

 

When I go to Directory > Profile Sources, there's a single 'Active Directory' source with a variable name of `corp.internal`, so I tried:

`Arrays.isEmpty(Arrays.toCsvString(Groups.startsWith("corp.internal","",100))) ? Groups.startsWith("OKTA","",100) : Arrays.flatten(Groups.startsWith("OKTA","",100),Groups.startsWith("corp.internal","",100))`

 

And this returns all Okta groups. This would indicate to me that the `Groups.startsWith("corp.internal","",100)` actually returned something but it was empty.

 

Any help appreciated, thanks.


  • User15949339338674567618 (Vendor Management)

    Hi,

     

    For this type of questions I would recommend to check Okta dev forum, due to the nature of the case, and the error you received, it is very likely that the access to your Org is required to proper troubleshoot the issue. My recommendation would be opening a case with the dev team to troubleshoot further.

    Expand Post
  • nwpyu (nwpyu)

    In oder to get AD Groups you need to use active_drectory instead OKTA, also the Number at the end is the character lenght not the amount of groups and be careful as this also counts the OU= on which the group is located for example

     

    MyGroup,OU=Security Groups,DC=subdomain,DC=domain,DC=com this is equal to 57 characters if your rule has 50 on it, it will return the could not be evaluated error

     

    try the following in order to evaluate and show AD groups and OKTA groups

    Arrays.isEmpty(Arrays.toCsvString(Groups.startsWith("active_directory","",100))) ? Groups.startsWith("OKTA","",100) : Arrays.flatten(Groups.startsWith("OKTA","",100),Groups.startsWith("active_directory","",100))

     

    JUST BE CAREFUL if you Array.isEmpty tries to evaluate anything with more than 100 characters it will give you the same evaluation error

     

    Basically the rules for this is, make sure your AD Name and Path doesn't have more than 100 characters, Same for the OKTA Group Name

     

    Expand Post
  • nwpyu (nwpyu)

    Forgot to mention so far OKTA doesn't allow more than 100 characters unfortunately 😞

This question is closed.
Loading
Trouble retrieving Active Directory groups in OpenID Connect claims