The Basic Authentication plugin requires at least one Consumer to work. When you create the Consumer, you must specify a username and password, for example: Ariel:Password
. The Consumer’s password must be base64-encoded when it’s used in the Authentication header. For example, Ariel:Password
would become QXJpZWw6UGFzc3dvcmQ=
.
Then, you can enable the plugin on a Gateway Service, Route, or globally. When a Consumer makes a request to the associated Gateway Service or Route, the plugin checks for valid credentials in the Proxy-Authorization
and Authorization
headers (in that order).
You can use the Basic Authentication plugin along with other authentication plugins. This allows clients to use different authentication methods to access a given Gateway Service or Route.
The authentication plugins can be configured to always require authentication or only perform authentication if the Consumer wasn’t already authenticated. For more information, see Using multiple authentication methods.