Hi Community , @Olu ,
We are trying to have 1 endpoint and allow Basic Auth and Bearer Token keys to authenticate on it.
Right now, I can make it work for Basic Auth, but unable to make the right settings to allow Bearer token.
I’ve seen some examples, here’s what we tried so for regarding the configuration.
(1) [Multiple Authentication mechanisms in Tyk - #2 by ahmet]
This page defines each Authorization config as below.
"auth_configs": {
"authToken": {
...
},
"basic": {
}
}
First question, are these values correct “authToken” and “basic” as key names?
In the “auth_header_name”, my understanding is that it’s a configurable value.
(2) In the multi-authentication page Multiple Auth, there are some values that apparently are required for this configuration and also have a different key. Can someone confirm if those are required?
"To enable this mode you must set the base_identity_provided_by field in your API Definitions to one of the supported chained enums below:
AuthToken
HMACKey
BasicAuthUser
JWTClaim
OIDCUser
OAuthKey
UnsetAuth
…
You can explicitly set auth token support by setting use_standard_auth to true.
"
So, our API definition was like below:
{...},
"base_identity_provided_by": "auth_token", # is this required? is it the right value?
"use_basic_auth": true,
"use_keyless": false,
"use_standard_auth": true # when I set this to true, basic auth stop working
"auth": {
"auth_header_name": "Authorization"
},
"auth_configs": {
"authToken": { # is authToken the right value here?
"use_param": false,
"param_name": "",
"use_cookie": false,
"cookie_name": "",
"auth_header_name": "AuthToken",
"use_certificate": false,
"validate_signature": false,
"signature": {
"algorithm": "",
"header": "",
"secret": "",
"allowed_clock_skew": 0,
"error_code": 0,
"error_message": ""
}
},
"basic": {
"use_param": false,
"param_name": "",
"use_cookie": false,
"cookie_name": "",
"auth_header_name": "Authorization",
"use_certificate": false,
"validate_signature": false,
"signature": {
"algorithm": "",
"header": "",
"secret": "",
"allowed_clock_skew": 0,
"error_code": 0,
"error_message": ""
}
}
},
"definition": {
"location": "header",
"key": "x-api-version"
},
"version_data": {
"not_versioned": true,
"versions": {
"Default": {
"name": "v1",
"use_extended_paths": true
}
}
},
{...}
Thanks in advance for your help and support.
-Daniel