<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
0D54z00008U5yVOCAZOkta Classic EngineAuthenticationAnswered2023-10-07T18:00:19.000Z2022-12-07T15:01:47.000Z2023-05-09T19:59:48.000Z

JohnT.59157 (Customer) asked a question.

I need to create a Group claim filter that includes 4 specific groups

I need to create a Group claim to filter 4 groups.

Group names are: Apple, Orange, Grape, Tomato

 

In the "Groups claim filter" section in the Sign On tab of the Application configuration

 

1) Should I use "groups Contains" or should I use "groups Matches regex" option?

2) What is the syntax of the text to be entered for creating the filter ?

3) Is there a character limit for the filter?

 

 

 


raos.97771 likes this.
  • JohnT.59157 (Customer)

    Here is the Answer,

    Thanks to Daniel (okta support) and Don (customer)

    I took advice both and tested and found the following.

    Use groups matches regex and any of the following formats"

     

    ^(Apple|Orange|Grape)$

    (Apple|Orange|Grape)

    Apple|Orange|Grape

     

    Screenshot 👇

    2022-12-09 16_23_51-okta-dev-88726655 - OpenID Connect Client_ okta-express-sample 

    start of line, end of line and groupings can be used, but are not needed.

    Only | matters. | = OR operand

     

    Resulting idToken

    2022-12-09 16_24_17-JWT Debugger 

    Expand Post
    Selected as Best
  • DonF.81354 (Customer)

    Great question, as noted, if you want to send all groups be sure to select the Regex option and enter .* to send them all in the claim.

     

    As for sending only specific groups, such as in your example above, you can use the following:

     

    .*Group1.*|.*Group2*|.*Group3.*|.*Group4.*

     

    For specific groups, I would recommend you use "Matches Regex" using the above syntax. As for the character limit, I am unsure to be honest. I will look to see if that info is out there.

     

    Let us know if that works for you, thanks!

    Expand Post
    • JohnT.59157 (Customer)

      Thanks for your answer, however, I actually have many other groups. 10 in total, so .* will not work. I need to specify just the 4 needed, and exclude the 6 other groups.

    • JohnT.59157 (Customer)

      do I just enter this 👉 .*Apple.*|.*Orange*|.*Grape.*|.*Tomato.* in the filter text box? Or do I need quotes, parenthesis, brackets?

    • JohnT.59157 (Customer)

      Thanks for the additional information.

       

      Just one more point of clarification. Is the * meant to be a wildcard? Can I exclude that if I know the exact names that I want to filter?

       

      A wild card * might be helpful in some instances, but I want an explicit list.

       

       

      Expand Post
  • JohnT.59157 (Customer)

    Here is the Answer,

    Thanks to Daniel (okta support) and Don (customer)

    I took advice both and tested and found the following.

    Use groups matches regex and any of the following formats"

     

    ^(Apple|Orange|Grape)$

    (Apple|Orange|Grape)

    Apple|Orange|Grape

     

    Screenshot 👇

    2022-12-09 16_23_51-okta-dev-88726655 - OpenID Connect Client_ okta-express-sample 

    start of line, end of line and groupings can be used, but are not needed.

    Only | matters. | = OR operand

     

    Resulting idToken

    2022-12-09 16_24_17-JWT Debugger 

    Expand Post
    Selected as Best
    • DonF.81354 (Customer)

      Awesome stuff! Thanks for replying back and letting us know. Take care!

  • raos.97771 (Customer)

    Experts, need help..

     

    Group names in my okta tenanat are defined as below:

     

    aws#avm-xyz-abc_123#AVM_Dev#012345678910

    aws#avm-def-pqr_456#AVM_Adm#019876543210

     

    Arrays.toCsvString(String.replace(Arrays.toCsvString(Groups.startsWith("OKTA","aws#avm-xyz-abc_123#"|"aws#avm-def-pqr_456#",100)),"aws#avm-xyz-abc_123#","aws#avm-def-pqr_456#",""))

     

    Expectation:

    Only the groups name need to be captured in the token

     

    example:

    "groups": "AVM_Dev,AVM_Adm"

    Expand Post
This question is closed.
Loading
I need to create a Group claim filter that includes 4 specific groups
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply