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

swagger-ui is not mapping oauth2-redirect.html #428

Closed
ghost opened this issue Dec 27, 2020 · 1 comment · Fixed by #448
Closed

swagger-ui is not mapping oauth2-redirect.html #428

ghost opened this issue Dec 27, 2020 · 1 comment · Fixed by #448
Assignees
Labels
status: pr submitted A pull request has been submitted for the issue type: bug Something isn't working

Comments

@ghost
Copy link

ghost commented Dec 27, 2020

Describe the bug
Swagger-UI sets the redirect_uri for OAUTH2 requests to /oauth2-redirect.html. If this file doesn't exist, the Authorize dialog (after asking for scopes) returns to a 404 page (that includes a suggestion for /webjars/swagger-ui/3.20.9/oauth2-redirect.html).

Expected behavior
The authorize dialog successfully returns to swagger-ui with a token.

Expectation is that one of the following happens:

  • swagger-ui extension correctly configures swagger's redirect_uri to be /swagger-ui/oauth2-redirect.html (respecting parameters that may have changed /swagger-ui)

  • Micronaut is configured to respond to /oauth2-redirect.html

Actual behavior
The Authorize dialog (after asking for scopes) returns to a 404 page (that includes a suggestion for /webjars/swagger-ui/3.20.9/oauth2-redirect.html).

To reproduce

After login successful from the OKTA provider using Authorization code flow. The redirect URL from the swagger is below

http://localhost:8084/oauth2-redirect.html

This redirect URL cannot be found in the Micronauts application. The swagger UI should contain the redirect URL and should show the Authentication successful, and the redirect URL should be "https://localhost:8084/swagger/oauth2-redirect.html

Repo - https://github.com/anandjaisy/MicronautSwagger

Okta

Client Id - 0oa2lezagQ4wrRUnW5d6
Client secret - Z5amZFJcsW-OHC60q4sKqUOfNZG071SuCirMidg7

After successful login, the Micronaut application should display the swagger UI with a auth token

@ghost ghost changed the title OAuth 2 Authorization code flow redirect URI not working swagger-ui is not mapping oauth2-redirect.html Jan 15, 2021
@alvarosanchez alvarosanchez added status: awaiting validation Waiting to be validated as a real issue type: bug Something isn't working and removed status: awaiting validation Waiting to be validated as a real issue labels Jan 25, 2021
@alvarosanchez
Copy link
Member

Relates to #437

@alvarosanchez alvarosanchez self-assigned this Jan 27, 2021
@alvarosanchez alvarosanchez added the status: pr submitted A pull request has been submitted for the issue label Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pr submitted A pull request has been submitted for the issue type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant