-
Notifications
You must be signed in to change notification settings - Fork 25
Scopes handling #127
Description
I will use this issue to try to describe how I think we should handle scopes. When we agree to something I will go forward and open a PR.
Right now we have scope_supported
which is used to define the scopes that are advertised in the well-known endpoint as well as the scopes that we allow. This can be overridden per client with the allowed_scopes
parameter.
If someone wants to override the scopes mapping then he must use the custom_scopes add on.
We would like to be able not to advertise all the scopes that are supported. Also I think that it would be nice to have a scopes mapping per client.
So I propose that remove the existing scopes configuration and introduce the following:
scopes_mapping
(maybe simplyscopes
is a better name?): A dict defining the scopes that are allowed to be used per client and the claims they map to (defaults to the scopes mapping described in the spec). If we want to define a scope that doesn't map to claims (e.g. offline_access) then we simply map it to an empty list. E.g.:
{
"scope_a": ["claim1", "claim2"],
"scope_b": []
}
scopes_supported
(maybeallowed_scopes
is better?): A list with the scopes that are allowed to be used (defaults to the keys inscopes_mapping
).advertised_scopes
: A list with the scopes that will be advertised in the well-known endpoint (defaults toscopes_supported
).
In addition to those configuration options we should also have the corresponding per client ones for scopes_supported
and scopes_mapping
.
@rohe @peppelinux what do you think? Should I go ahead and implement this?