-
In our use case prototype, we amongst other things, dynamically bind the lifetime of tokens based on the scopes. The scope represents access levels. For the initial test, we had a few fixed levels (1-3), each having a separate scope, which worked without problems. However, in the end we need a more fine granular approach, like levels from 1-100. Instead of having 100 scopes, we consider using a spontaneous scope. This worked well except for setting the lifetime over an UpdateToken script, as the spontaneous scope does not appear in context.getGrant().getScopes() - Is there an alternative way to get this scope or are spontaneous scopes and UpdateToken scripts incompatible? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I would request @yuriyz to comment on this. |
Beta Was this translation helpful? Give feedback.
-
It should appear if globally and on client level it is properly configured. Global AS config
Client level config should have :
https://docs.jans.io/v1.0.21/admin/auth-server/scopes/#spontaneous-scopes |
Beta Was this translation helpful? Give feedback.
I see,
context.getClient()
returns server side constructed object. You can change any value there includingallowSpontaneousScopes
.Like this:
context.getClient().getAttributes().setAllowSpontaneousScopes(true);