-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Auth Error, Error: Bad Request #4905
Comments
Hi @bozzltron!
Any idea what changed?
|
I have the same error with json format. |
My underlying API has not changed. It looks like I was running on a forked version of swagger-express-ui when I updated swagger ui to 3.4.2 to get things working. Since then we tried to moved back to swagger-express-ui proper and that's when we encountered this new issue. Here is my original commit off of the fork. What version of swagger-ui is swagger-ui-express running now? |
i have run the swagger-ui 3.19.3 which is the latest. |
Bug confirmed - prioritizing this. |
@bozzltron, upon further investigation, my impression is that we're doing this correctly. OAuth2 says (emphasis mine):
Since Swagger UI is able to use HTTP basic to transmit the client credentials, we do that instead of including it in the request body. Let me know if you think I've misinterpreted the spec - happy to take another look. |
I believe, @shockey is right at his interpretation of the spec, so it seems that Swagger UI does the right thing (i.e. uses HTTP Basic authentication headers to provide |
Thanks for the clarification here. For future readers the basic authorization header is constructed by base 64 encoded a string that contains client_id and client_secret and is delimited by ":". |
Hey @shockey , sorry to comment on a closed thread but would it be possible to allow the HTTP Basic authentication method or the body method? I'm stuck in the middle now where my authentication provider only allows the body method, so integrating that and swagger-ui seems impossible. I appreciate swagger-ui follows the spec correctly, but supporting both way would be helpful for people stuck in my position. |
@pacey, can you email me about this? I have a branch here, I'd like for you to take a look and tell me if it addresses your use case. |
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Describe the bug you're encountering
I am no longer able to authentication through live docs. Debugging the POST request to /oauth/token via chrome devtools shows that the client_id and client_secret are not being send. grant_type is and is the correct value "client_credentials".
To reproduce...
Steps to reproduce the behavior:
Expected behavior
Should authenticate
Screenshots
Additional context or thoughts
I know that the yaml config for OAuth2 is being consumed because its giving me the OAuth2 authentication form. The break down is in sending the entered credentials.
The text was updated successfully, but these errors were encountered: