ベーシック認証
HTTP Basic Authentication is one of the least resource-demanding techniques that enforce access controls to the Web resources. It uses fields in the HTTP header and does not require HTTP cookies, session identifiers, or login pages.
An HTTP user agent, such as a web browser, uses an Authorization
header to provide a user name and password in each HTTP request. The header is specified as Authorization: Basic <credentials>
, where credentials are the Base64 encoding of the user ID and password joined by a colon, as shown in the following example.
If the user name is Alice
and the password is secret
, the HTTP authorization header would be Authorization: Basic QWxjZTpzZWNyZXQ=
, where QWxjZTpzZWNyZXQ=
is a Base64 encoded representation of the Alice:secret
string.
The Basic Authentication mechanism does not provide confidentiality protection for the transmitted credentials. The credentials are merely encoded with Base64 when in transit and not encrypted or hashed in any way. Therefore, Basic Authentication is used with HTTPS to provide confidentiality.
Basic Authentication is a well-specified, simple challenge and response scheme that all web browsers and most web servers understand. However, there are a few limitations associated with Basic Authentication, which include:
- 認証情報がプレーンテキストで送信されます
-
Use HTTPS with Basic Authentication to avoid exposing the credentials. The risk of exposing credentials as plain text increases if a load balancer terminates HTTPS, as the request is forwarded to Quarkus over HTTP.
また、マルチホップデプロイメントでは、クライアントと最初のQuarkusエンドポイント間のみでHTTPSを使用し、次のQuarkusエンドポイントにHTTPで認証情報を伝達する場合、認証情報が漏洩する可能性があります。
- 認証情報はリクエスト毎に送信されます
-
ベーシック認証では、ユーザー名とパスワードをリクエスト毎に送信する必要があります。これは、認証情報が漏洩するリスクを高めます。
- アプリケーションの複雑性の増大
-
The Quarkus application must validate that usernames, passwords, and roles are managed securely. This process, however, can introduce significant complexity to the application. Depending on the use case, other authentication mechanisms that delegate username, password, and role management to specialized services might be a better choice.