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

Oauth authorization fail produce a generic error message #4048

Closed
wayglem opened this issue Dec 22, 2017 · 3 comments · Fixed by #4058
Closed

Oauth authorization fail produce a generic error message #4048

wayglem opened this issue Dec 22, 2017 · 3 comments · Fixed by #4058

Comments

@wayglem
Copy link
Contributor

wayglem commented Dec 22, 2017

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? any
Which Swagger-UI version? 3.7.0
How did you install Swagger-UI? yes
Which browser & version? Firefox 56
Which operating system? Linux/Ubuntu

Expected Behavior

When using oauth access_code but it's probably the same for authorization code.
User clicks on Authrorize button and an oauth error occurs (for exmaple unknown client_id).
The authorization server shall informs the client by redirecting to the redirect URI and adding an error query parameter (optionally error_description and error_uri too). c.f RFC
User should see those information when back to swagger-ui in the error message.

Current Behavior

User only gets a harcoded error message

Authorization failed: no accessCode received from the server

Possible Solution

It's possible to get the error, error_description and error_uri in the query params of oauth-redirect page. I can make a PR if someone can confirm that the oauth-redirect.html file is not generated (never worked on react)

@shockey
Copy link
Contributor

shockey commented Dec 22, 2017

Hi @wayglem!

I can make a PR if someone can confirm that the oauth-redirect.html file is not generated (never worked on react)

You're correct: dist/oauth2-redirect.html is not generated 😄 looking forward to a PR!

@antechrestos
Copy link

@shockey : is this still ok for you? @wayglem made a PR but no news from your side.
If we miss something, please tell us what we need to do to comply with your requirements.

Thanks 😄

antechrestos pushed a commit to wayglem/swagger-ui that referenced this issue Feb 12, 2018
This change aims to display the oauth error to the user when the autnetication process fails.

Close swagger-api#4048
shockey pushed a commit that referenced this issue Feb 13, 2018
This change aims to display the oauth error to the user when the autnetication process fails.

Close #4048
@DonMartin76
Copy link
Contributor

DonMartin76 commented Aug 8, 2018

This is unfortunately still not working correctly for the client_credentials flow; fn.fetch throws an error and because of this the user just gets a generic "Error: Unauthorized" or "Error: Bad Request" if e.g. the Authorization Server answers with a 401 or 400 (which is according to the spec).

I will create a PR on this.

DonMartin76 added a commit to DonMartin76/swagger-ui that referenced this issue Aug 8, 2018
…ation call

- Inspect the error and error_description properties of the response, if available
shockey pushed a commit that referenced this issue Aug 8, 2018
* Additional fix of #4048, more error messages from authorization call
  Inspect the error and error_description properties of the response, if available
* Fixed linter errors
@lock lock bot locked and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants