1

I am working on the definition of a service contract with swagger 2.0. my question is : what is the right method to define Bearer token authentication in swagger 2.0? FYI : I have find to methods in internet what is the right one?

method 1 : securityDefinitions: Bearer: type: apiKey name: Authorization in: header security: - Bearer: []

method 2 : securityDefinitions: ApiKeyAuth: type: apiKey name: X-API-Key in: header security: - ApiKeyAuth: []

AmineParis
  • 351
  • 1
  • 5
  • 11
  • The 1st example is correct. Possible duplicate of [How can I represent 'Authorization: Bearer ' in a Swagger Spec (swagger.json)](https://stackoverflow.com/questions/32910065/how-can-i-represent-authorization-bearer-token-in-a-swagger-spec-swagger-j) – Helen Dec 20 '18 at 09:32
  • thank you ... it's right – AmineParis Dec 20 '18 at 10:34

0 Answers0