swagger-api / swagger-api/swagger-ui

apiKey pairs not represented well in UI

Open
#3,521 23 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: auth needs: UX/design input P2 type: bug version: 3.x
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

When using apiKey pairs as per: https://swagger.io/docs/specification/authentication/api-keys/

Or in the case of my config below, the Swagger UI still continues to show the two keys as seperate authorizable entries rather than an AND case as they should be handled.

image

"securityDefinitions": {
    "username": {
      "type": "apiKey",
      "name": "X-Username",
      "in": "header"
    },
    "key": {
      "type": "apiKey",
      "name": "X-ApiKey",
      "in": "header"
    }
  },
  "security": [
    {
      "username": [

      ],
      "key": [

      ]
    }
  ]

Experiencing this with the latest version as of posting.

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 behavior in Swagger UI with the provided securityDefinitions and security configuration, focusing on how apiKey authorization entries are rendered. Compare the displayed entries with the Swagger authentication documentation. Done means the username and key definitions are represented as one authorization requirement with AND semantics rather than as separate authorizable entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.