swagger-api / swagger-api/swagger-ui
Authorize button: logout is not clearing credentials
Nobody has claimed this yet.
- 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: [Mint]
- Browser: [chrome]
- Version: [80]
- Method of installation: [e.g. npm, dist assets]
- Swagger-UI version: [3.25.1]
- Swagger/OpenAPI version: [Springdoc-openapi: 1.3.9]
Content & configuration
@Bean
public OpenAPI customOpenAPI() {
return new OpenApi()
.components(new Components().addSecuritySchemes("basicScheme",
new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("basic")))
.addSecurityItem(new SecurityRequirement().addList("basicScheme",
Collections.singletonList("basic")));
}
Example Swagger/OpenAPI definition:
springdoc:
endpoint: "/swagger"
pathsToMatch: /v1/**
api-docs:
enabled: true
path: ${springdoc.endpoint}/v3/api-docs
swagger-ui:
path: ${springdoc.endpoint}/swagger-ui.html
cache:
disabled: true
Describe the bug you're encountering
During the logout from Authorize button, I see that "curl" doesn't contain the header with Authorize, but it seems credentials still exist in session.
To reproduce...
Steps to reproduce the behavior:
The scenario for basic auth:
- Call secured endpoint from swagger-ui list and got proper unauthorized information.
- Click Authorize button
- Set login and password
- Call secured endpoint and got the proper result from swagger-ui list
- Click Authorize button
- Click Logout button
- Call the same endpoint from points 1 and 4, but there should be information like unauthorized, but still got the proper result expected only for logged user.
Note:
- I have tried to set at point 7 the same username but wrong password - still didn't get unauthorized information.
- When set another wrong username at point 7 finally got proper unauthorized information.
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
Reproduce the basic-auth flow in Swagger UI using the steps in the issue, then inspect the authorize and logout behavior that controls request credentials. Done means logging out removes the stored credentials so a subsequent call to the secured endpoint returns unauthorized, including when the same username is reused.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- authentication, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100