feat: Expose scopes granted by user#1107
Merged
sai-sunder-s merged 9 commits intogoogleapis:mainfrom Dec 21, 2022
Merged
Conversation
27616cc to
f02442a
Compare
TimurSadykov
reviewed
Dec 8, 2022
f02442a to
0142ca5
Compare
TimurSadykov
approved these changes
Dec 20, 2022
| expiresBy = accessToken.getExpirationTime(); | ||
| List<String> grantedScopes = accessToken.getScopes(); | ||
|
|
||
| if (grantedScopes != null) { |
There was a problem hiding this comment.
this should not be necessary, list can be serialized to json, no?
Contributor
Author
There was a problem hiding this comment.
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.
Its just had to be List ) Generic does not exist at runtime )
lsirac
approved these changes
Dec 20, 2022
7ebcd91 to
d6d35e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.