[email protected]
and the password is 1234567
(see base64encode.org)
components.securitySchemes
object using the type: http
and scheme: basic
:
Authorization
header, but Tyk is configurable, via the Tyk Vendor Extension, to support custom header keys and credential passing via query parameter or cookie.
authentication.stripAuthorizationData
field (Tyk Classic: strip_auth_data
).
securitySchemes
mechanism allows only one location for the user credentials, but in some scenarios an API might need to support multiple potential locations to support different clients.
The Tyk Vendor Extension supports this by allowing configuration of alternative locations in the basic auth entry in server.authentication.securitySchemes
. Building on the previous example, we can add optional query and cookie locations as follows:
extractCredentialsFromBody
field to the basic auth entry in server.authentication.securitySchemes
, for example:
cacheTTL
seconds (Tyk Classic: basic_auth.cache_ttl
).
If you do not want to cache user credentials, you can turn this off using disableCaching
in the basic auth entry in server.authentication.securitySchemes
(Tyk Classic: basic_auth.disable_caching
).
use_basic_auth
option. This will default to expect the user credentials in the Authorization
header.
Authorization
for the header location, but you can replace this if required)POST /api/apis/keys/basic/{username}
endpoint in the Tyk Dashboard API. The request payload is a Tyk Session Object (access key).
basic_auth_data.password
within the request payloadPOST
method to create a new user and PUT
to update an existing entry.
org_id
is set correctly and consistently so that the Basic Authentication user is created in the correct organization.POST /tyk/keys/{username}
endpoint in the Tyk Dashboard API. The request payload is a Tyk Session Object (access key).
basic_auth_data.password
within the request payloadPOST
method to create a new user and PUT
to update an existing entry.
org_id
is set correctly and consistently so that the Basic Authentication user is created in the correct organization.