Sovrain
  1. Documentation
  2. Identity provider
  3. For admins

How-to guide

Send roles to apps

Attach a role to a group's access so that the application receives it as the role claim or attribute and can set permissions.

This guide tells an application what each person may do there, for example that members of Engineering are editors and members of Admins are administrators. You attach a role to a group’s access; Sovrain sends the roles of the signed-in person to the application as role.

A role is free text that Sovrain passes on unchanged. It gives no rights inside Sovrain. What it means is up to the application, so use the exact values the application expects.

Before you start

  • Find the role values the application understands, for example editor and admin, and where it reads them. Many applications let you name the claim or attribute; set it to role.
  • The groups must already have access to the application, or you add them in the next steps. See Give a group access to an app.

Give a group a role

  1. On your home page, under Administration, select Open admin, then select Applications and open the application.
  2. Open the Access & diagnostics tab.
  3. Under Group access:
    • for a group that is already listed, type the role in its Role field. It saves on its own;
    • for a new group, select Add group, choose the group, type the role in the role field and select Add.

A person in several listed groups gets every role of those groups. Groups with an empty role add none. People receive changed roles at their next sign-in to the application.

Make sure an OpenID Connect app receives the roles

An OpenID Connect application gets role only together with the groups scope.

  1. Open the Relying Party (RP) tab.
  2. Under Scopes & options, tick groups.
  3. Make sure the application asks for the groups scope when it signs people in.

The ID token and the userinfo answer then hold role, a list of the person’s roles, sorted, and groups, the names of the person’s groups that have access to this application. When the person has no role, role is left out.

What a SAML app receives

A SAML application gets a role attribute with one value per role. Nothing else needs to be set. If you also map an attribute to the name role on the Subject & attributes tab, the roles from group access replace it whenever the person has any.

Sovrain sends no groups attribute to SAML applications. If the application needs to know a person’s group, give each group a role instead.

Check what the application receives

Sign in to the application as a member of the group and look at what it shows as the person’s role. For an OpenID Connect app, a developer can also decode the ID token.