cancel
Showing results for 
Search instead for 
Did you mean: 

API key security not imported from Swagger (OAS3) yaml

SOLVED
Highlighted
Occasional Contributor

API key security not imported from Swagger (OAS3) yaml

I've imported an open API specifications version 3.0 yaml file at creating a new project. This Swagger OAS definition contains security:

security:
- apiKeyBAG: []

 

and in the #/components/securitySchemes:

  securitySchemes:
    apiKeyBAG:
      type: apiKey
      name: X-Api-Key
      in: header

In ReadyApi SoapUI I don't find this header anywhere and haven't found a way to add this in the Auth Manager. This means I have to manually add this header to every operation in the API.

 

Is there something wrong with the way this was defined in the Swagger file? (I wouldn't think so, SwaggerHub does recognize the security)

Or is there another way to get and use the defined security (api key)?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Thank you for the advice nmrao!

 

Hi @fsamwel , I see that you did go to the Support Team with this issue.

Let me copy their reply here:

 

>>

Currently, the "API Key" authentication type is not available in ReadyAPI, and the "apikey" security scheme specified in a Swagger/OpenAPI definition is ignored on import. 
We already have an enhancement request for supporting the "API Key" type in Auth Manager - its internal ID is RIA-12389. I've increased its rating based on your inquiry. 

In the meantime, we can suggest the following options:
1. Add the header parameter to each resource (example: https://s3.eu-west-1.amazonaws.com/ccfileshare/natalie/2020/2020-03-04_13-57-18.png) - it's quicker than adding the header to each request.
2. Use an event handler that adds the needed header to outgoing requests (example: https://s3.eu-west-1.amazonaws.com/ccfileshare/natalie/2020/2020-03-04_14-02-07.png). Note: you can filter requests which the handler should be applied to - you can find an example here: https://smartbear-cc.force.com/portal/KbArticleViewer?name=How-to-make-event-RequestFilter-filterReq...

 <<


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

Understand that ReadyAPI support OAS 3.0. If experiencing issue, then good to have support request for quick help.

If the request header is required, that can be done, please check documentation
https://support.smartbear.com/readyapi/docs/requests/ui/editor/request/bottom/headers.html



Regards,
Rao.
Highlighted
Community Manager

Thank you for the advice nmrao!

 

Hi @fsamwel , I see that you did go to the Support Team with this issue.

Let me copy their reply here:

 

>>

Currently, the "API Key" authentication type is not available in ReadyAPI, and the "apikey" security scheme specified in a Swagger/OpenAPI definition is ignored on import. 
We already have an enhancement request for supporting the "API Key" type in Auth Manager - its internal ID is RIA-12389. I've increased its rating based on your inquiry. 

In the meantime, we can suggest the following options:
1. Add the header parameter to each resource (example: https://s3.eu-west-1.amazonaws.com/ccfileshare/natalie/2020/2020-03-04_13-57-18.png) - it's quicker than adding the header to each request.
2. Use an event handler that adds the needed header to outgoing requests (example: https://s3.eu-west-1.amazonaws.com/ccfileshare/natalie/2020/2020-03-04_14-02-07.png). Note: you can filter requests which the handler should be applied to - you can find an example here: https://smartbear-cc.force.com/portal/KbArticleViewer?name=How-to-make-event-RequestFilter-filterReq...

 <<


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors