keycloak-scim/server_admin/topics/roles/role-scope-mappings.adoc

32 lines
1.8 KiB
Text
Raw Normal View History

[[_role_scope_mappings]]
2016-05-25 15:08:14 +00:00
=== Role Scope Mappings
2016-05-25 15:08:14 +00:00
When an OIDC access token or SAML assertion is created, all the user role mappings of the user are, by default, added as claims
within the token or assertion. Applications use this information to make access decisions on the resources controlled by that
2017-08-28 12:50:14 +00:00
application. In {project_name}, access tokens are digitally signed and can actually be re-used by the application
2016-05-25 15:08:14 +00:00
to invoke on other remotely secured REST services. This means that if an application gets compromised or there is a rogue
client registered with the realm, attackers can get access tokens that have a broad range of permissions and your whole
network is compromised. This is where _role scope mappings_ becomes important.
2016-05-25 15:08:14 +00:00
_Role Scope Mappings_ is a way to limit the roles that get declared inside an access token. When a client requests that a user
2016-06-03 18:07:00 +00:00
be authenticated, the access token they receive back will only contain the role mappings you've explicitly specified
2016-05-25 15:08:14 +00:00
for the client's scope. This allows you to limit the permissions each individual access token has rather than giving the
client access to all of the user's permissions. By default, each client gets all the role mappings of the user.
You can view this in the `Scope` tab of each client.
.Full Scope
2017-08-28 12:50:14 +00:00
image:{project_images}/full-client-scope.png[]
2016-05-25 15:08:14 +00:00
2016-06-03 18:07:00 +00:00
You can see from the picture that the effective roles of the scope are every declared role in the realm.
2016-05-25 15:08:14 +00:00
To change this default behavior, you must explicitly turn off the `Full Scope Allowed` switch and declare the specific roles you want in each individual
client. Alternatively, you can also use <<_client_scopes, client scopes>>
to define the same role scope mappings for a whole set of clients.
2016-05-25 15:08:14 +00:00
.Partial Scope
2017-08-28 12:50:14 +00:00
image:{project_images}/client-scope.png[]
2016-05-25 15:08:14 +00:00