Swagger-ui: Authorization value is lost on refresh

Created on 6 Sep 2018  路  5Comments  路  Source: swagger-api/swagger-ui

Q&A (please complete the following information)

  • OS: Ubuntu
  • Browser: Chrome
  • Version: 68
  • Method of installation: docker hub
  • Swagger-UI version: 3.18.2
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

components:
  securitySchemes:
    x-api-token:
      type: apiKey
      name: x-api-token
      in: header
  links: {}
  callbacks: {}
security:
  - x-api-token: []

Describe the bug you're encountering


Authorization value is lost on refresh

To reproduce...

Steps to reproduce the behavior:

  1. Click on 'Authorize'
  2. Enter value
  3. Press 'Authorize'
  4. Refresh the page
  5. Click 'Authorize' again

Expected behavior


I should see "Value: **"

Screenshots


screenshot from 2018-09-06 06-26-58
screenshot from 2018-09-06 06-27-47

Additional context or thoughts


I thought that's the whole purpose of authorize button - to save user session so that it's not lost on refresh

auth enhancement

Most helpful comment

Is this going to be merged anytime soon ?
It is pretty troublesome to put the authentication part in every time you refresh the UI.

All 5 comments

Should be easily fixable using solution like this: https://github.com/rt2zz/redux-persist

+++

Pushed fixed version to docker hub: vanuan/swagger-ui:persist-authorization

Is this going to be merged anytime soon ?
It is pretty troublesome to put the authentication part in every time you refresh the UI.

5939 implements this and includes a feature flag (disabled by default).

I hope SmartBear folks will take a look soon!

Was this page helpful?
0 / 5 - 0 ratings