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

OAuth2AuthorizationRequestRedirectFilter needs error handling customization #14572

Closed
willemvd opened this issue Feb 9, 2024 · 3 comments
Closed
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@willemvd
Copy link

willemvd commented Feb 9, 2024

Expected Behavior

The AuthorizationRequestRedirectFilter should have failure handler which by default uses the implementation of the unsuccessfulRedirectForAuthorization method. AuthorizationRequestRedirectFilter should have a setter to override the default failure handler with a custom implementation

Current Behavior

Currently the unsuccessfulRedirectForAuthorization always set a HTTP 500 for all errors that occur while preparing the call to the external IDP.

Context

Because the code statically returns a HTTP 500 it makes it hard (using custom filters or overriding the response object) to trigger other behavior like for example forwarding to custom (external) error page.
We are using a DefaultOAuth2AuthorizationRequestResolver with an authorization request customizer that checks stuff in the user session to determine from which flow the user is coming, but when this fails we cannot direct the user to another location

@willemvd willemvd added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Feb 9, 2024
@willemvd
Copy link
Author

willemvd commented Feb 9, 2024

relates to #4641 and #5546 but both do not resolve this

@willemvd
Copy link
Author

willemvd commented Feb 9, 2024

basically duplicate of #13793

@willemvd willemvd closed this as completed Feb 9, 2024
@willemvd willemvd closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
@sjohnr
Copy link
Member

sjohnr commented Feb 9, 2024

Thanks @willemvd. Yes, I believe this is a duplicate of gh-13793. Feel free to comment on gh-14168 if you have any thoughts on my latest comments on that PR.

@sjohnr sjohnr added status: duplicate A duplicate of another issue in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 9, 2024
@sjohnr sjohnr self-assigned this Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants