Skip to content
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

Open
wants to merge 1 commit into
base: 4.3.x
Choose a base branch
from

Conversation

lgw-gravitee
Copy link
Contributor

fixes AM-4731

Copy link
Contributor

@leleueri leleueri left a 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 🤔

@lgw-gravitee lgw-gravitee force-pushed the fix/AM-4731-ext-grant-message branch from 2d3410c to ab5897a Compare February 10, 2025 12:06
@lgw-gravitee lgw-gravitee force-pushed the fix/AM-4731-ext-grant-message branch from ab5897a to bea5257 Compare February 10, 2025 14:34
@@ -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())));
Copy link
Contributor

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())));
Copy link
Contributor

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())));
Copy link
Contributor

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" 🤔 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants