Hi,
I am using the documentation to set up an API with basic auth using the OAS format. Unfortunately this do not work.
{
"info": {
"title": "test webservice",
"version": "1.0.0"
},
"openapi": "3.0.3",
"components": {
"securitySchemes": {
"my_auth": {
"scheme": "basic",
"type": "http"
}
}
},
"security": [
{
"my_auth": []
}
],
"paths": {
},
"x-tyk-api-gateway": {
"info": {
"name": "Test webservice",
"id": "test-webservice",
"state": {
"active": true,
"internal": false
}
},
"upstream": {
"url": "http://nginx/service/test"
},
"server": {
"authentication": {
"enabled": true,
"securitySchemes": {
"my_auth": {
"enabled": true,
"header": {
"name": "Authorization"
}
}
}
},
"listenPath": {
"strip": true,
"value": "/test/"
}
}
}
}
Tyk send me the following response back:
{
"status": "error",
"message": "x-tyk-api-gateway.server.authentication.securitySchemes.my_auth: Must validate at least one schema (anyOf)\nx-tyk-api-gateway.server.authentication.securitySchemes.my_auth.header: enabled is required"
}
Based on the documentation I do not know what I am doing wrong.
I have some questions:
- what is wrong with my API Definition?
- is the configuration of the basic auth in the API Definition mandatory or Tyk default auth mechanism is set to basic auth?
- the example given in the documentation do not mention that we need to set up the property “enabled”: true in the “authentication” object. I discovered this in the error message sent by Tyk. Could you please maybe update the example?
"message": "x-tyk-api-gateway.server.authentication: enabled is required ...
- I have the use case for setting up an API Definition without authentication. Is keyless the right word for that? how can I configure the API OAS Definition to allow no auth?
Thank you!
Kind regards