OAuth2 redirect broken in WebFlux when context-path is not set to root
See original GitHub issueDescribe the bug
When spring.webflux.base-path
is set to a different context, the oauth2-redirect.html is broken. It tries to send you to root.
For instance, after authenticating at /v1/webjars, the redirect sends you to /webjars. You can change the path and it closes the redirect.
To Reproduce Steps to reproduce the behavior:
- What version of spring-boot you are using?
- 2.5.6
- What modules and versions of springdoc-openapi are you using?
- security
- webflux
- What is the actual and the expected result using OpenAPI Description (yml or json)?
- Provide with a sample code (HelloController) or Test that reproduces the problem
Expected behavior Redirected to /context-root/webjars/…
Screenshots
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Context Path with Webflux - Stack Overflow
I've been trying to find a way to set the context path for a webflux application. I know I ...
Read more >Spring Boot Change Context Path - Baeldung
Learn various ways of changing the context path in your Spring ... Spring Boot, by default, serves content on the root context path...
Read more >POST call using context-path not working in spring boot 2.x ...
Coding example for the question POST call using context-path not working in spring ... /hello is main/root path and your endpoint is specified...
Read more >Spring Security Reference
Explicit WebFlux Security Configuration. 5.7. OAuth 2.0 Login. 5.7.1. Spring Boot 2.0 Sample. Initial setup; Setting the redirect URI; Configure ...
Read more >Deploy a Spring Boot Application into Tomcat - Okta Developer
Tomcat started on port(s): 8080 (http) with context path ... That is, a Login Redirect of http://localhost:8080/login/oauth2/code/okta and a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@optimisticninja,
First, make sure you are using the last stable version
v1.5.12
, before reporting any issues. There is no known issues with the OAuth2 redirect url.I have updated the demos, that shows it is just working fine with
spring.webflux.base-path
.If you are still facing the issue, then i invite to provide a sample test like this one, which explains what you are facing.
This ticket will be now closed and can reopened if any relevant information is provided.
Thank you and sorry for wasting your time. 1.5.12 fixed the issue.