swagger-api / swagger-api/swagger-ui

OAuth 2 with authorization code flow uses wrong callback url

Open
#4,676 3 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: auth P2 type: bug
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: macOS
  • Browser: chrome
  • Version: 67
  • Method of installation: none
  • Swagger-UI version: current online version
  • Swagger/OpenAPI version: both Swagger 2.0 and OpenAPI 3.0
Describe the bug you're encountering

We have OAuth2 authorization code flow implemented. Our API documentation is build using OpenAPI v3. Using https://editor.swagger.io/ does not work for us, because there is a bug with the callback url.

Swagger Editor should either provide means to change the callback url required or should at least get it right.

Expected: https://editor.swagger.io/oauth2-redirect.html
Actual: http://localhost:3200/oauth2-redirect.html

Expected behavior

Using OAuth2 with authorization code flow should work while using https://editor.swagger.io/.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the OAuth 2 authorization-code flow in the online Swagger Editor and trace how the callback URL is selected. Compare the generated URL with the expected https://editor.swagger.io/oauth2-redirect.html; done means authorization uses that HTTPS callback and works for the reported OpenAPI 3 setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
authentication, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.