-
Notifications
You must be signed in to change notification settings - Fork 1.3k
NullPointerException when not specifying the token_type_hint for the revoke token endpoint #170
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
Comments
So, I actually see this paramters is OPTIONAL in the RFC. So I guess if it's not given, the authorization server should be able to find the token without the hint. Still, it shouldn't throw a NullPointerException token_type_hint OPTIONAL. A hint about the type of the token
|
Thanks for reporting this @lspil. This is indeed a bug at: Thanks for taking this on! |
Hi. I got a new issue. If I omit to specify the token_type_hint request parameter for the revocation token I get a NullPointerException.
In my opinion, I should get a 4XX HTTP status with a nice message as it happens if I omit the token for example (or for the other endpoints like /token). Please let me know if you consider this an issue as well and if yes, you can assign it to me. I can take care of it.
Steps to reproduce: Call the /oauth2/revoke endpoint without specifying the token_type_hint request parameter.
Result:
java.lang.NullPointerException: Cannot invoke "org.springframework.security.oauth2.server.authorization.TokenType.getValue()" because "tokenType" is null
at org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService.hasToken(InMemoryOAuth2AuthorizationService.java:67) ~[main/:na]
at org.springframework.security.oauth2.server.authorization.InMemoryOAuth2AuthorizationService.lambda$findByToken$0(InMemoryOAuth2AuthorizationService.java:61) ~[main/:na]
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176) ~[na:na]
at java.base/java.util.concurrent.ConcurrentHashMap$ValueSpliterator.tryAdvance(ConcurrentHashMap.java:3620) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
The text was updated successfully, but these errors were encountered: