-
Notifications
You must be signed in to change notification settings - Fork 6k
OAuth2AuthorizationCodeGrantWebFilter should handle OAuth2AuthorizationException #8609
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
Some |
@wjlc @iilkevych Thank you for this report. The issue is in The fix should be in Would either of you be interested in submitting a PR for this? |
@shazin This is not the correct place for the fix. plz check the issue and replicate it. https://github.com/spring-projects/spring-security/issues/7884#issue-558408713 |
@jgrandja but my oauth2Login() configured
|
@wjlc Thanks for the feedback. It looks like |
This is not only issue for As I mentioned above:
and |
Which specific implementations are you referring to? |
|
Ah yes. Ok let me think about what changes are required here. |
Thanks for all the feedback @wjlc @iilkevych. I just pushed the fix in these commits 4c902bb da4b626. This has been backported to 5.1.x. |
@jgrandja just in case, will this redirect user to /login? |
@iilkevych |
@jgrandja |
you can add custom |
@iilkevych Regarding your comment
I think this is where the confusion is? OpenID Connect 1.0 extends the OAuth 2.0 Authorization Framework and addresses authentication. The |
Who is authorizing what in OAuth 2.0 Authorization Framework? I believe resource owner authorizes access to resource by client. There is nothing about authorizing anything to anybody in client app. Am I wrong? |
@iilkevych I would recommend reading the specs to understand the difference between OAuth 2.0 Authorization Framework (Authorization) and OpenID Connect 1.0 (Authentication). The links are provided in the previous comment. Also, it's not clear to me if you are still seeing an issue (bug) or missing functionality? I feel like this conversation has gone down a different path from the original issue. If you feel the current functionality is missing something or there is a bug then I would propose that you put together a minimal sample that reproduces the issue so I can better understand what you are expecting. |
@jgrandja |
@jgrandja
The problem is not in
authorization_code
.AuthenticationWebFilter
hasauthenticationFailureHandler
to handle invalid authentication(authorization_code
).OidcAuthorizationCodeReactiveAuthenticationManager
throwsOAuth2AuthenticationException
which isAuthenticationException
and browser is redirected to/login?error
The problem is in
ServerOAuth2AuthorizationCodeAuthenticationTokenConverter
it throwsOAuth2AuthorizationException
andAuthenticationWebFilter
doesn't handle any errors fromServerAuthenticationConverter
Only one ServerAuthenticationConverter implementation will redirect browser to login page
ServerHttpBasicAuthenticationConverter
cause it returnMono.empty()
in case of any authentication problemOriginally posted by @iilkevych in #7884 (comment)
The text was updated successfully, but these errors were encountered: