2

My OpenAPI definition includes Cookie authentication. In the Swagger Editor, the curl command works fine, but "try it out" does not add the Cookie header in requests. Any idea why?

openapi: 3.0.0
servers:
  - url: 'XXXXXXX'
info:
  description: xxxxx
  version: 1.0.0
  title: xxxxx
  contact:
    email: xxxxxx

paths:
  '/tenants/{tenant_id}/call/projects':
    get:
      tags:
        - project
      operationId: getProjects
      parameters:
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/project'
      security:
        - apiKey: []

components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: auth-token
      in: cookie
Helen
  • 87,344
  • 17
  • 243
  • 314
Arun Tanwar
  • 31
  • 1
  • 3
  • Possible duplicate of [Sending cookie session id with Swagger 3.0](https://stackoverflow.com/questions/49272171/sending-cookie-session-id-with-swagger-3-0) – Helen May 01 '18 at 10:22
  • Please see the linked question. Cookie auth is not currently supported in Swagger UI and Swagger Editor because of browser restrictions (more details in https://github.com/swagger-api/swagger-js/issues/1163). – Helen May 01 '18 at 10:23

0 Answers0