swagger-api / swagger-api/swagger-ui

initOAuth with an array

Open
#4,087 10 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there any scope for initOAuth being able to handle multiple config definitions, such that a user can select one of many configs to make OAuth requests with?

E.g:

ui.initOAuth([{
        clientId: "first-client-id",
        clientSecret: "your-client-secret-if-required",
        appName: "App 1",
        scopeSeparator: " ",
        additionalQueryStringParams: {}
      }, {
        clientId: "second-client-id",
        clientSecret: "your-client-secret-if-required",
        appName: "App 2",
        scopeSeparator: " ",
        additionalQueryStringParams: {}
      }]);
Q A
Bug or feature request? Feature Request
Which Swagger/OpenAPI version? 2.0+
Which Swagger-UI version? 3.9
How did you install Swagger-UI? Git clone
Which browser & version?
Which operating system?
Expected Behavior

Given an array of oauth configurations, the UI should allow a user to select which app name they want to use to make a request.

Current Behavior

Only a single oauth configuration is possible.

Context

My users will likely have various client ids/secrets depending on the what each application does. I'd like them to be able select a single one from the various they might have active.

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 at the initOAuth entry point and trace how the current single OAuth configuration is stored and consumed by the authorization UI. Define how multiple configurations and their appName values are selected, then verify that the chosen client configuration is used for OAuth requests; no test or source file is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.