
TylerC.76272 (Customer) asked a question.
Hello there. I've been following the documents on okta's expression language here:
- https://developer.okta.com/docs/reference/okta-expression-language/
- https://developer.okta.com/docs/reference/okta-expression-language-in-identity-engine/
My company has a setup in which we have one okta tenant connected to our Active Directory , HubTenant (to pull over groups), then that tenant is connected to our production customer tenant, AppTenant (serving as a host for our customer's Identity Providers and our application registrations). We're saving all of the groups, customer and internal company members, on a Directory Profile attribute called "roles". This attribute is a String Array. This attribute get's populated as intended after authenticating.
We're using OIDC to authenticate our customer's with our applications, so we have many authorization servers setup in the AppTenant, each customer getting their own auth endpoint. We're customizing the claims on each of these endpoints as well, including expressing the mentioned "roles" attribute as a "roles" claim on the access tokens.
The expression I have for this is as follows (user.roles != null) ? Arrays.flatten(Groups.startsWith("OKTA","",25), user.roles) : Groups.startsWith("OKTA","",25)
While this works really well in expressing every group the user is a part of in okta, as well as their "roles" directory profile attribute, we have a business need to limit the groups on our internal company members to just the ones they need for the customer, depending on which authorization server they used. We thought we could do this with an expression to filter the "roles" array on a custom claim. The group names in this string array follow a concise naming convention of "<client-code> <group name>", and we have a need to filter all string values in this array matching a certain client code.
I initially thought that filtering an Array would be simple, but I haven't been able to find a way to do it with the available documentation. Is there a way I could filter a String Array according to a certain string value?

Hello @TylerC.76272 (Customer) ,
The links that you are using are the correct ones, in order to help you with the creation of a custom expression you may need to reach our help desk support team.
You can use the link below as a reference to reach our helpdesk team and get further assistance with your situation.
https://help.okta.com/en/prod/Content/Topics/Directory/get-support.htm
Regards,
Natalia
Okta Inc.