-
Notifications
You must be signed in to change notification settings - Fork 23
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
AM-4731 ext grant message #5438
base: 4.3.x
Are you sure you want to change the base?
Conversation
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 is not the only place where InvalidGrantException is thrown without message. Looks like there is another InvalidGrantException in package io.gravitee.am.gateway.handler.oauth2.exception
. Maybe the ExtensionGrant should use the exception coming from the handler 🤔
2d3410c
to
ab5897a
Compare
fixes AM-4731
ab5897a
to
bea5257
Compare
@@ -111,7 +111,7 @@ protected Single<TokenRequest> parseRequest(TokenRequest tokenRequest, Client cl | |||
@Override | |||
protected Maybe<User> resolveResourceOwner(TokenRequest tokenRequest, Client client) { | |||
return userAuthenticationManager.loadPreAuthenticatedUser(tokenRequest.getSubject(), tokenRequest) | |||
.onErrorResumeNext(ex -> { return Maybe.error(new InvalidGrantException()); }); | |||
.onErrorResumeNext(ex -> Maybe.error(new InvalidGrantException(ex.getMessage()))); |
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.
question: should we test if message is null to provide generic message something like "unable to read user profile" 🤔 ?
@@ -128,7 +128,7 @@ protected Single<TokenRequest> parseRequest(TokenRequest tokenRequest, Client cl | |||
@Override | |||
protected Maybe<User> resolveResourceOwner(TokenRequest tokenRequest, Client client) { | |||
return userAuthenticationManager.loadPreAuthenticatedUser(tokenRequest.getSubject(), tokenRequest) | |||
.onErrorResumeNext(ex -> { return Maybe.error(new InvalidGrantException()); }); | |||
.onErrorResumeNext(ex -> Maybe.error(new InvalidGrantException(ex.getMessage()))); |
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.
question: should we test if message is null to provide generic message something like "unable to read user profile" 🤔 ?
@@ -108,7 +108,7 @@ protected Maybe<User> resolveResourceOwner(TokenRequest tokenRequest, Client cli | |||
} | |||
|
|||
return userAuthenticationManager.loadPreAuthenticatedUser(subject, tokenRequest) | |||
.onErrorResumeNext(ex -> { return Maybe.error(new InvalidGrantException()); }); | |||
.onErrorResumeNext(ex -> Maybe.error(new InvalidGrantException(ex.getMessage()))); |
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.
question: should we test if message is null to provide generic message something like "unable to read user profile" 🤔 ?
|
fixes AM-4731