Who can use an app, and the groups and roles claims
Restrict each app your organization registers to named teams and people, and choose whether its tokens carry the user's team ids and organization roles.
Every app your organization registers admits only your organization's members, unless you open it to end users. You can narrow that further, per app, to the teams and people who should use it. And you can let an app read which of your teams a user is in, and their role in your organization, from the tokens it receives, so it can map them to its own permissions without a directory of its own.
Both settings live on the app, under Settings → Organization → Apps → your app. Only an owner or an admin of the organization can change them. Every change is recorded in the audit log.
Who can use the app
| Setting | Who gets in |
|---|---|
| All members (the default) | Every member of your organization. For a workspace app, every member of that workspace. |
| Assigned members and teams | Only the people you assign, and the members of the teams you assign. |
Choose Assigned members and teams, then add teams and people. The list of who that adds up to is shown under the setting. A team counts only while it belongs to your organization, and a person only while they are a member.
Scrydon checks this every time someone signs in to the app and every time
the app refreshes a token. Someone you unassign, or who leaves an assigned
team, is refused at their next sign-in or refresh: the app receives
access_denied, and the refusal is in the audit log with the reason
not_assigned (or not_member for someone who is not a member at all).
Assigned members and teams with nobody assigned refuses every member. The page asks you to confirm before you switch to it with an empty list, or remove the last team or person.
What this does not do:
- Tokens the app already holds stay valid until they expire. To cut someone off at once, suspend their account (Managing accounts).
- An app has one client per environment. The page applies a change to every environment of the app, but an environment you add later starts with All members and no claims; set it again.
The groups and roles claims
An app receives neither claim until you turn it on. Under Token claims:
| Switch | Scope the app asks for | Claim | Value |
|---|---|---|---|
| Teams (groups) | groups | groups | The ids of the user's teams in your organization, as a list. An empty list for a member of no team. |
| Roles (roles) | roles | roles | The user's organization roles (owner, admin, member, or your custom roles), as a list. |
Turn a switch on, then have the app ask for the scope (scope=openid profile email groups roles). The claims are in the ID token, the access token and
the userinfo response. They are recomputed at every refresh, so a user who
leaves a team loses it at the app's next refresh.
The claims carry ids, not names: a team id never changes and is unique, while a name can be renamed and can match another organization's team. A team's id is the last part of the address of its page, opened from Settings → Organization → Members.
Many teams. A token carries at most 150 team ids. Past that, groups
is left out and the token carries groups_overflow: true; the app then reads
the list from the userinfo endpoint, which returns up to 1000 (and
overflows the same way past that).
An app that asks for a scope you have not turned on is refused with
invalid_scope. Turning a switch off therefore makes the app's next
refresh with that scope fail with invalid_scope too, until it signs the
user in again without it.