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

Cookie not send using swagger-ui 3.3.2 and OpenAPI 3 #3785

Closed
whyvrafvr opened this issue Oct 19, 2017 · 3 comments
Closed

Cookie not send using swagger-ui 3.3.2 and OpenAPI 3 #3785

whyvrafvr opened this issue Oct 19, 2017 · 3 comments
Assignees

Comments

@whyvrafvr
Copy link

Hi folks.

I cannot send cookies using the latest docker image of swagger-ui (3.3.2) with OpenAPI3. Obviously, I get the same behavior with the git src.
Request is sent but Cookie field is empty.
I've thought it was now supported. Probably my bad but I'd like to check.
Cheers.

{
  "openapi" : "3.0.0",
  "servers" : [ {
    "url" : "https://localhost:8181/comptandye/restapi",
    "description" : "Dev server"
  } ],
  "info" : {
    "description" : "comptandye API.  You should require authentification first on \n[https://www.comptandye.fr](https://www.comptandye.fr)",
    "version" : "0.8.2",
    "title" : "comptandye",
    "contact" : {
      "email" : "[email protected]"
    }
  },
  "tags" : [ {
    "name" : "Address",
    "description" : "Manage Addresses"
  } ],
  "paths" : {
    "/Address" : {
      "get" : {
        "tags" : [ "Address" ],
        "summary" : "Finds all Addresses",
        "parameters" : [ {
          "in" : "cookie",
          "name" : "JSESSIONID",
          "schema" : {
            "type" : "string"
          },
          "required" : true
        }, {
          "in" : "cookie",
          "name" : "csrftoken",
          "schema" : {
            "type" : "string"
          },
          "required" : true
        } ],
        "operationId" : "findAll",
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/Address"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components" : {
    "schemas" : {
      "Address" : {
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "street" : {
            "type" : "string"
          },
          "optional" : {
            "type" : "string"
          },
          "postalCode" : {
            "type" : "string"
          },
          "city" : {
            "type" : "string"
          },
          "country" : {
            "type" : "string"
          }
        }
      }
    },
    "securitySchemes" : {
      "cookieAuth" : {
        "type" : "apiKey",
        "in" : "cookie",
        "name" : "JSESSIONID"
      },
      "api_key" : {
        "type" : "apiKey",
        "name" : "api_key",
        "in" : "header"
      }
    }
  }
}
@shockey
Copy link
Contributor

shockey commented Oct 21, 2017

This is a known issue - it's almost impossible to send arbitrary cookie data to a different origin from within the browser, see swagger-api/swagger-js#1163.

@whyvrafvr
Copy link
Author

Thank you for your reply @shockey. So, let's wait and see ;)

@shockey
Copy link
Contributor

shockey commented Nov 30, 2017

Closing in favor of swagger-api/swagger-js#1163 - stay tuned over there!

@shockey shockey closed this as completed Nov 30, 2017
@lock lock bot locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants