Skip to main content
Version: Canary ๐Ÿšง

Basic Authorization

Basic Authorization is a simple HTTP authentication mechanism used to verify the identity of users accessing resources. It ensures that only authorized users can access protected resources by passing user credentials (usually username and password) through the HTTP request header.

Basic Authorization is an authentication method based on the HTTP protocol, which encodes the username and password into a Base64 format and includes it in the HTTP request header. The server authenticates based on the credentials passed.

Working Principleโ€‹

  • Encoding Credentials: The client concatenates the username and password in the format "username:password" and encodes them using Base64.
  • Transmitting Credentials: The encoded credentials are added to the Authorization field in the HTTP request header, prefixed with "Basic".
  • Server Verification: Upon receiving the request, the server parses the Authorization field, decodes the Base64 string, and verifies the correctness of the username and password.

Operation Demonstrationโ€‹

  1. When configuring authentication, select Basic as the authentication type and fill in the authentication information:

Field NameDescription
Parameter LocationThe location where the authentication check is placed in the request, supports Header, Query, Body
Parameter NameThe name of the parameter
UsernameThe username
PasswordThe user password
Expiration TimeUser expiration time, if not filled it never expires, precise to the day
Hide Authentication InfoWhether to hide authentication info when forwarding to upstream services

When including the authentication information, the access result is as shown below:

Example Result