swagger-api / swagger-api/swagger-ui
initOAuth with an array
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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