swagger-api / swagger-api/swagger-ui
Hiding of password field with PKCE enabled, prevents usage of client_credentials, when API has multiple authentication methods.
@char0n is already working on this.
Since Mar 24, 2022.
- 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: Windows
- Browser: Chrome
- Version: 99
- Method of installation: nuget
- Swagger-UI version: 4.5.0
- Swagger/OpenAPI version: OpenAPI 3.0.1
Content & configuration
After feature #7438 got merged in, then multiple security schemes with the following scenario:
- OAuth with autorization_code flow with PKCE
- OAuth with client_crendentials
Results in the password field is hidden for client_credentials.
Swagger-UI configuration options:
SwaggerUI({
"usePkceWithAuthorizationCodeGrant": true
})
Describe the bug you're encountering
(flow === AUTH_FLOW_APPLICATION || flow === AUTH_FLOW_ACCESS_CODE || flow === AUTH_FLOW_PASSWORD) && !isPkceCodeGrant &&
should have been
(flow === AUTH_FLOW_APPLICATION || (flow === AUTH_FLOW_ACCESS_CODE && !isPkceCodeGrant) || flow === AUTH_FLOW_PASSWORD) &&
Originally posted by @chrklin in https://github.com/swagger-api/swagger-ui/issues/7438#issuecomment-1077566962
To reproduce...
Steps to reproduce the behavior:
- Enabled PKCE
- Add client credentials security scheme
- Add code flow security scheme
- Click Authorize
- See missing password field on client_credentials flow
Expected behavior
If we keep the functionality from #7438 then the flow with autorization code flow with pkce should have the password field hidden and the password field for the client_credentials shown
Screenshots

Additional context or thoughts
A different issue is that you might actually want to use password with PKCE, since they cover different security related things.
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.
Assessment
This issue has not been assessed yet.