This problem is only noticed in test environment.
Prod environment works fine.
I used the following method in swagger spec for Authorization JWT token. The API uses an apikey to validate requests.
security:
- apiClientId: []
.
.
.
securitySchemes:
apiClientId:
type: apiKey
in: header
name: x-apikey
In Prod environment, when I trace the request I can see Authorization request header is passed.
But in test environment its not part of the request.
If I add this to swagger spec:
security:
- apiClientId: []
- bearerAuth: []
.
.
.
securitySchemes:
apiClientId:
type: apiKey
in: header
name: x-apikey
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
This will work as it passes the Authorization header in request. However, I dont want to use this approach because even though it works in test environment, it behaves different in prod.
In prod environment, it will ask for basic authentication.
Please advice if this is a bug or there is a solution.