Assigning User Claims to Roles in a Workspace

Create custom experiences for each type of user on the server by specifying which role a user has and which workspaces they can access. Refer to Assigning Users to Roles in a Workspace for more details about role mapping.

  1. In Access Control, click Workspaces.
  2. Find the workspace you want to add users to and click » Edit workspace.
  3. Click Role mappings.
  4. Click +Mapping and enter any claim as the attribute and the return value for the claim as the value for the mapping.
    Figure 1. Example Response from userinfo_endpoint
    {
        "email": "jane.doe@ni.com",
        "family_name": "Doe",
        "given_name": "Jane",
        "name": "Jane Doe",
        "ni_employee": "2670",
        "sub": "jdoe"
    }


    Note
    • All string values are case sensitive.
    • If the claim value is a scalar, it must exactly match the value you specify in the role mapping .
    • If the claim value is an array, one of the array elements must exactly match the value you specify in the role mappings.
    • If the claim value contains quotes, you must escape the quotation marks with a backslash. Refer to the following example and the following figure.
    Figure 2. Example response from userinfo_endpoint with quotation marks
    {
      "userinfo": {
        "sub": "88442211",
        "country": "US",
        "name": "Bob Smith",
        "http://www.example.come/roles": [
          "user",
          "a\"b"
        ]
      }
    }


  5. Select the role you want to assign to the user.
  6. Click Update.
    Log out and log back in for the new mappings to take effect.