<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
0D54z00008LS56oCADOkta Identity EngineWorkflowsAnswered2024-04-13T03:49:27.000Z2022-11-04T17:39:35.000Z2022-11-07T19:51:45.000Z
  • 953nz (953nz)

    Yes, here are a few options to accomplish your goal:

     

    #1 you can setup a flow with the following cards: when "User Created", "Read User" (to grab the department or any other attribute of user created), "If/Else" card and set condition to "Department == XYZ". If true, then use a "Add User to Group" card. If false, then use a "Return Error" card.

     

    #2 Simply use group rules in the Okta admin console. For instance, If "user.department == XYZ", then add them to XYZ group(s). This takes away the need for a Workflow and is much more straightforward. It is not as flexible though, so if you are looking to expand then a Workflow is a great choice.

     

    #3 Finally, and a bit more complicated, Okta has a template that you can use for this use case and it is pretty flexible. It is "Manage Okta Group Membership Based on Profile Attributes", but the flow itself is much more complex than option #1. Walkthrough for this can be found here: Workflows Template: Manage Okta Group Membership Based on Job Code or Profile Attribute Mapping

     

    Hope this helps!!

     

    Thanks

    Expand Post
  • 953nz (953nz)

    Your best bet, assuming it has to be a workflow (I am partial to #2 given the stated need here), is most likely number one as it includes the fewest components. It might be a good use case to get used to Workflows on then build out to their provided template.

     

    Again, I would simply use the trigger, or "When this happens" in the flow, to be "User created". Follow the rest after as stated above. Please feel free to share any screenshots of what you have and I will be happy to assist.

     

    Image is not available
     

    Please see attached for very high level overview.

     

    thanks!!

    Expand Post
  • This needs to be a workflow because it is more than just adding users to groups.

     

    When I try to use the add user to group all I get is an error that the group can't be found. I have tried using the group name as well as the group ID with no luck. I checked and my trigger of new user created and read user cards are working, but the if/else card doesn't appear to be working. This is what I have:

     

    2022-11-07_11-45-30It always give me a group not found error.

    Expand Post
  • 953nz (953nz)

    Great stuff so far then! So first and foremost, for the Group ID, do not use the group name but instead use the group ID, such as "00g1dtnxx3mvwCAgr0h8". You can find that in your URL when selecting the group via the Admin UI.

     

    As for the If/Else not working, do make sure the value is a copy paste to ensure no pesky spaces or anything throwing it off. As for the "Read User" card as well, make sure you are dragging over "Okta User" > "ID" to get the User ID of the account created. This will use the actual "User ID" of the user created and will give the accurate "Department" value of the user created.

    Expand Post
  • 953nz (953nz)

    Finally, under the "Add User to Group" card and in the "User ID" input, do not use the "Username" value but instead drag over the same "Okta User" > "ID" value outlined above in my last comment. The IDs these cards refer to are not their friendly names but instead their actual ID's.

  • Thank you! The ID was the issue. I thought I had tried that but apparently I either copied a space or something else.

This question is closed.
Loading
Add new user to multiple groups using workflows