question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OAuth2 redirect broken in WebFlux when context-path is not set to root

See original GitHub issue

Describe 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 image image

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bnasslahsencommented, Nov 17, 2021

@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.

0reactions
optimisticninjacommented, Nov 17, 2021

Thank you and sorry for wasting your time. 1.5.12 fixed the issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found