<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
0D51Y00008W3UqOSAVOkta Classic EngineSingle Sign-OnAnswered2025-10-30T09:00:12.000Z2020-05-19T12:10:13.000Z2020-05-21T20:41:22.000Z

ngh66 (ngh66) asked a question.

Problem mapping user profile using Expression Language

I am trying to create a mapping for github teams, where I use the expression language to check the group(s) that a user belongs in and assigning a github team to have the user added to. I get no Syntax error, but when testing my example, it yields no results.

 

Let's say we want to add all Okta users to a team named "everyone" on GitHub and all Okta users in the "Engineering" Okta group to "engineering" team on Github. My expression looks something like

isMemberOfGroup("Engineering") ? {"everyone", "engineering"} : {"everyone"}. I am trying to integrate with GitHub Teams, which is a SWA application and not a SAML application.

 

Testing this gives a null value, yet the user belongs to the Engineering group. I am stuck at this point and could do well with some help.

 

Simon


  • vh2rj (vh2rj)

    Hi Simon,

     

    The error that you are getting is caused by the expression you selected.

    isMemberOfGroup expects that you pass the groupId rather then the name

    So to have that function you will need to use isMemberOfGroupName

     

    https://developer.okta.com/docs/reference/okta-expression-language/#group-functions

     

    Also being SWA I'm not sure those informations are being passed, given that swa functionality is just a fancy bookmark and it purpose is to inject the credentials and sign in the user. If you have provisioning then yeah that is different and should function.

     

    Expand Post
    • ngh66 (ngh66)

      Thank you Marius,

       

      I have changed it to isMemberOfGroupName("Engineering") ? {"everyone", "engineering"} : {"everyone"} and now I get an error message saying "We found some errors. Please review the form and make corrections."

       

      Sorry to bug, but this is somewhat confusing.

      Expand Post
      • VanH.30758 (Lytx, Inc.)

        Hey Simon,

         

        It's possible your situation is different but I had an issue before where I had to pass multiple values to an SP for group access.

         

        The solution that worked for me was to pass over the values as arrays.

         

        It would calculate if they qualified and if not pass over a blank entry in the array and then move onto the next condition.

         

        So in your example, I think it would look something like this (forgive syntax errors):

         

        Arrays.flatten(isMemberOfGroupName("Engineering")?"engineering",isMemberOfGroupName("Everyone")?"everyone":"everyone"

         

        Hope that helps.

        Expand Post
This question is closed.
Loading
Problem mapping user profile using Expression Language