swagger-api / swagger-api/swagger-ui

Oauth2.0 Implicit flow is not working

Open
#7,180 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Q&A
  • Browser: all
  • Method of installation: Docker image
  • Swagger-UI version: swaggerapi/swagger-ui:v3.43.0
  • Swagger/OpenAPI version: OpenAPI 3.0.1
Content & configuration

Example Swagger/OpenAPI definition:

securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://oauthUrl/oauth2/authorize
          refreshUrl: https://oauthUrl/oauth2/token
          scopes: {}
Describe the bug you're encountering

When using Oauth2.0 Implicit flow, the authorization flow is carried properly and the Swagger UI shows that the user is authorized. However, if the user tries to make a request, the Swagger UI shows that the token is undefined and the request cannot be carried.

To reproduce...

Steps to reproduce the behavior:

  1. Press Authorize button
  2. Authorize via implicit flow
  3. Execute a request
Screenshots

Authorization seems to be OK...
imagen

... but really the token is not obtained
imagen

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

Start by reproducing the implicit-flow authorization with the provided Docker image and OpenAPI 3.0.1 definition, following the three listed steps. Trace how Swagger UI obtains and applies the token after authorization; the issue is done when the token is no longer undefined and is included in the executed request.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.