Pode icon indicating copy to clipboard operation
Pode copied to clipboard

Swagger Authentication Options

Open port-43 opened this issue 1 year ago • 4 comments

Question

I am using a modified version of the api authentication scheme. It requires the client to provide an X-API-KEY and X-API-KEY-ID. These values are used to hash and store the key in a backend database. I am unable to use the swagger UI to test authenticated routes because there isn't an option to set the other required header. Is there a method to address this?

port-43 avatar Dec 11 '23 18:12 port-43

You can create 2 ApiKeys authentication schemas and merge them using Merge-PodeAuth

mdaneri avatar Dec 12 '23 00:12 mdaneri

Thanks for the quick response, I am looking through the docs but there isn't a good example of what is needed to in the -ScriptBlock for merging multiple authenticated users into 1.

port-43 avatar Dec 14 '23 20:12 port-43

I was able to figure out how to get it to work, unfortunately swagger only shows the two api key auth options and excludes the merged options. Populating both auth options doesn't work either because swagger doesn't include them when testing the route with merged auth setup.

port-43 avatar Dec 14 '23 21:12 port-43

I'm working on extending the Open API in Pode. This will be part of Pode 2.10 What you are asking is there. The code is completed so I'm not expecting any major changes.

Here is the link https://github.com/mdaneri/Pode

What is new : https://github.com/Badgerati/Pode/pull/1136

mdaneri avatar Dec 14 '23 21:12 mdaneri