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

UI Authorize button - OAuth2 with clientCredentials returns error of CORS #1650

Closed
weesftw opened this issue May 7, 2022 · 3 comments
Closed
Labels
invalid This doesn't seem right

Comments

@weesftw
Copy link

weesftw commented May 7, 2022

After configuring the securitySchemes and filling in all the elements (flows, tokens, scopes), the button to authenticate returns the CORS error and the OAuth server side is ok... it seems to me that swagger-ui does not send headers valid CORS, how can I configure this?

  • spring-boot version 2.6.6
  • Using springdoc-openapi-ui version 1.6.8

example swagger.yaml.

example

@bnasslahsen
Copy link
Collaborator

@weesftw,

CORS is related to your configuration.
You need to have CORS enabled, on your applications that is blocking the swagger-ui.

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label May 8, 2022
@weesftw
Copy link
Author

weesftw commented May 8, 2022

@weesftw,

CORS is related to your configuration. You need to have CORS enabled, on your applications that is blocking the swagger-ui.

@bnasslahsen,

The question is: do I need to configure CORS on the part of my application that is swagger-ui or oauth server?

@bnasslahsen
Copy link
Collaborator

@weesftw,

You should allow CORS requests.
The answer depends on each application architecture...

@springdoc springdoc locked as too heated and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants