-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Expose scopes granted by user #1107
Conversation
27616cc
to
f02442a
Compare
f02442a
to
0142ca5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Date expiresBy = null; | ||
if (accessToken != null) { | ||
acessTokenValue = accessToken.getTokenValue(); | ||
expiresBy = accessToken.getExpirationTime(); | ||
List<String> grantedScopes = accessToken.getScopes(); | ||
|
||
if (grantedScopes != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be necessary, list can be serialized to json, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List can be serialized but while deserializing it gets complicated. It is not possible to do an instance of check for List. I get this error: "Cannot perform instanceof check against parameterized type List. Use the form List<?> instead since further generic type information will be erased at runtime"
There are ways to deserialize like using Gson and seems to be another library called jackson that can help. But there is no need to complicate I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just had to be List ) Generic does not exist at runtime )
7ebcd91
to
d6d35e2
Compare
Token response from the IDP contains scopes that were granted by the user. This PR adds functionality to expose those scopes to the developer code.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.