Cookie Authentication Not working for openapi 3.0

Issue #278 resolved
Shobhit Saxena created an issue

When using the cookie authentication , the securityschemes are not checked and passed through without validation even if the mentioned securityScheme are not present.

Reference: https://swagger.io/docs/specification/authentication/cookie-authentication/

E.g.:

In securitySchemes

  "CookieAuth": {
    "type": "apiKey",
    "in": "cookie",
    "name": "cookie_name"
  }

In security at an operation:

    "security": [
      {
        "CookieAuth": []
      }
    ]

Now even if the cookie with name “cookie_name“ is not present in the request , the request is passed through successfully without security validations, even other securitySchemes validations are also skipped.

Possible problem is cookie in the apiKey is not supported as of now, as we can see in below code only Header and Query is supported:

https://bitbucket.org/atlassian/swagger-request-validator/src/fe8dd7110d6c23b98ccef435a2b5a55248fc4e89/swagger-request-validator-core/src/main/java/com/atlassian/oai/validator/interaction/request/SecurityValidator.java#lines-95

Comments (6)

  1. Shobhit Saxena reporter

    Hi James,

    Did you get a chance to check/implement this ?

    Regards,

    Shobhit Saxena

  2. James Navin

    I haven’t had time, no. Happy to review PRs, but it might be a few more weeks before I get time to allocate to this.

    Cheers.

  3. Log in to comment