Skip to content

Add an option to customize ServerRedirectStrategy in the OAuth2AuthorizationRequestRedirectWebFilter  #11373

@igorbolic

Description

@igorbolic

It would be nice to be able to customize the redirect strategy within OAuth2AuthorizationRequestRedirectWebFilter, so that we are able to return to the client e.g. HTTP Status 200 OK with redirect URL in the response payload, instead of the default behavior of HTTP Status 302 Found with Location header containing redirect URL.

Our FE is SPA and BE is Spring Boot application. The FE uses XMLHttpRequests client to retrieve the redirect URL from our BE service for the OAuth authorization flow.
The current OAuth2AuthorizationRequestRedirectWebFilter's response causes the FE client library to automatically follow Location URL.
Sending the response as HTTP Status 200 OK and having redirect URL as part of the payload via custom ServerRedirectStrategy, would allow us inform the FE client of the redirect URL and use the value to send the user to the OAuth providers page for authorization.

ATM we have a custom implementation of OAuth2AuthorizationRequestRedirectWebFilter, where we have changed only the ServerRedirectStrategy to achieve the above mentioned behavior.

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions