Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist authorization data across browser close/refresh for OpenAPI Swagger UI #4314

Closed
2 tasks done
nlykkei opened this issue May 10, 2024 · 2 comments · Fixed by #4312
Closed
2 tasks done

Persist authorization data across browser close/refresh for OpenAPI Swagger UI #4314

nlykkei opened this issue May 10, 2024 · 2 comments · Fixed by #4312

Comments

@nlykkei
Copy link
Contributor

nlykkei commented May 10, 2024

Use case

Currently, each time the user refreshes the Swagger UI or closes the browser, the authorization data, e.g. OAuth 2.0 tokens, is lost, which forces the user to re-authenticate to call APIs.

While one may argue that transient authorization data is more secure, it's not a great user experience. Many web applications persist short-lived tokens.

The persistAuthorization option to Swagger UI persists the authorization data in local storage, so it remains across browser close/refresh:

https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/#:~:text=persistAuthorization

Solution/User Experience

Provide an extra argument persist_authorization to enable_swagger()

Alternative solutions

No response

Acknowledgment

@leandrodamascena
Copy link
Contributor

Thanks for opening this! Working to merge the PR

@leandrodamascena leandrodamascena added event_handlers openapi-schema and removed triage Pending triage from maintainers labels May 12, 2024
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Shipped
2 participants