# Plug-in description

The HTTP Basic Auth plugin is used for basic authentication of the HTTP standard

# Instructions for use

When a route requires HTTP Basic authentication verification, you can add the BasicAuth plug-in to the route details page for verification. You need to configure an account before use. It supports routing level and global accounts. When the same account exists at the routing level and global level, the routing level account takes precedence.

For the global account, configure the user name and password for access in "Gateway Management->Plug-in Management". The custom configuration format is as follows:

{"users":{"abc":"Abcd1234!","xyz":"123456"}}

Multiple accounts can be configured, and 2 account passwords are configured above:

  • User 1: abc is the username, Abcd1234! is the password
  • User 2: xyz is the username, 123456 is the password

For routing-level accounts, configure the access username and password in the BasicAuth plug-in of "Gateway Management->Routing Management->Routing Details". The format is as follows:

{"userName1":"password","userName2":"123456"}

Two account passwords are configured above:

  • User 1: userName1 is the username, password is the password
  • User 2: userName2 is the username, 123456 is the password

When accessing the interface corresponding to the route, if there is no Authorization request header, the verification will fail and a 403 HTTP status code will be returned. Authorization request header format: Authorization Basic xxx (xxx is a Base64 (username:password) string)