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

Session cookie header parameter support #1951

Closed
pavel-vasiluk opened this issue Jan 13, 2022 · 1 comment
Closed

Session cookie header parameter support #1951

pavel-vasiluk opened this issue Jan 13, 2022 · 1 comment

Comments

@pavel-vasiluk
Copy link

pavel-vasiluk commented Jan 13, 2022

I have got some API-endpoints that are designed to have protected access via session-cookie. And as far as I understand, OpenAPI specification supports it, but I cannot really make it work via nelmio features.

  1. I have added session cookie parameter to config:
        components:
            securitySchemes:
                Cookie:
                    type: apiKey
                    name: PHPSESSID
                    in: cookie
  1. Authorization has been added to UI. I have added the Cookie.
    image

  2. Then I proceed to endpoint scheme and press execute. And get redirected response (302, no active session). After debugging it. I see that Cookie header has been ignored to be set.
    image

  3. However if I execute curl (shown in the screenshot above), I am able to get authorized content by provided session cookie.

Is it an expected behavior, or a known bug, or some design decision to not support session cookie parameter?
As according to Swagger documentation, this feature is supported https://swagger.io/docs/specification/authentication/cookie-authentication/

@pavel-vasiluk
Copy link
Author

Ok, going to close this, as I have found out that this feature is still not supported by swagger-js.
Related issues for those who investigating same problem as mine:
swagger-api/swagger-ui#3785
swagger-api/swagger-js#1163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant