cancel
Showing results for 
Search instead for 
Did you mean: 

Should Cookie auth from swaggerhub.com ui work and if so, what am I don't wrong?

sdmuuu
New Contributor

Should Cookie auth from swaggerhub.com ui work and if so, what am I don't wrong?

I'm trying to get cookie auth to work.  I'm using OpenAPI 3.0.0 that has this support, however, it's not working with the swagger hub ui on swaggerhub.com.  I have a login path that I don't include security on, and then following that requires the cookie that would have been sent in the login path.  Here is the path that requires the cookie to be sent:

 

/user/info:
   post:
      security:
         - SESSIONV2: []
      operationId: getLoggedInUser
      responses:
         '200':
         description: successful operation
         content:
            '*/*':
               schema:
                  type: string

 

# And this in components:

components:

   securitySchemes:
      SESSIONV2:
         type: apiKey 
            name: SESSIONV2
            in: cookie

2 REPLIES 2
MarcusJ
Moderator

Re: Should Cookie auth from swaggerhub.com ui work and if so, what am I don't wrong?

Hi,

 

There is an open feature request to send cookies with the SwaggerUI for version 3.x specs.  When this is implemented you should be able to send cookies using the try it out feature.

 

https://github.com/swagger-api/swagger-ui/issues/2895

 

Regards,

Marcus

SmartBear Support



Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
sdmuuu
New Contributor

Re: Should Cookie auth from swaggerhub.com ui work and if so, what am I don't wrong?

I'm not using SwaggerUI.  I'm using the UI on app.swaggerhub.com.  Or are you saying that site also uses SwaggerUI under the covers and it doesn't work yet?  

 

It's strange to me since cookies work when I use the swaggerUI and data from a swagger maven plugin generated using annotations from our spring based code.

 

Shane

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors