You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is data unique to scopes that, if preserved, would clean up code in a few places that need to recompute it each time.
For example, in BearerTokenAccessDeniedHandler, the scope attribute is returned with the list of scopes provided in the authentication token.
To find the scopes on the authentication token, though, it must rediscover the scope claim and then reparse it--two tasks that were already done during authentication.
Summary
There is data unique to scopes that, if preserved, would clean up code in a few places that need to recompute it each time.
For example, in
BearerTokenAccessDeniedHandler
, thescope
attribute is returned with the list of scopes provided in the authentication token.To find the scopes on the authentication token, though, it must rediscover the scope claim and then reparse it--two tasks that were already done during authentication.
ScopeGrantedAuthority
would look something like:This would require very little change to authority extraction:
would become
And about 20 lines in
BearerTokenAccessDeniedHandler
would become:Another example of where remembering the original scope is helpful is when constructing a
BearerTokenError
with thescope
parameter.The text was updated successfully, but these errors were encountered: