./prontouso.com
WEB & MẠNG

Tạo Header Xác Thực HTTP Basic Auth

Tạo chuỗi tiêu đề xác thực HTTP Basic Authentication chuẩn từ username và password để cấu hình Nginx, Apache, Postman hoặc cURL.

Trạng thái công cụChạy trên trình duyệt của bạn
Xem trước

Basic Auth Generator

Authorization header

Cách thức hoạt động

  1. Nhập dữ liệu của bạn

    Điền các giá trị cần thiết, dán văn bản hoặc tải lên tệp bạn muốn xử lý.

  2. Xem kết quả tức thì

    Hầu hết các công cụ cập nhật theo thời gian thực khi bạn nhập liệu; một số công cụ sử dụng một nút hành động duy nhất.

  3. Sử dụng kết quả

    Sao chép, tải xuống hoặc chia sẻ kết quả được tạo — bạn luôn có toàn quyền kiểm soát dữ liệu của mình.

Quyền riêng tư & xử lý dữ liệuChạy cục bộ 100% trên trình duyệt của bạn. Công cụ này không tải dữ liệu của bạn lên máy chủ.

Tạo Header Xác Thực HTTP Basic Auth là gì?

Build the base64-encoded Authorization header value for HTTP Basic Authentication from a username and password.

TÌM HIỂU CÁCH HOẠT ĐỘNG CỦA CÔNG CỤ

How to generate a Basic Authentication header

What Basic Auth is

HTTP Basic Authentication (RFC 7617) sends credentials as "username:password", base64-encoded, inside an Authorization header — Authorization: Basic <encoded value>. Base64 is an encoding, not encryption, so this scheme is only safe to use over HTTPS.

How to use it

  • Enter the username and password.
  • Copy the generated "Basic ..." header value.
  • Send it as the Authorization header on your request (in curl: -H "Authorization: Basic ...").

Security considerations

Because base64 is trivially reversible, never send this header over plain HTTP, and avoid Basic Auth entirely for anything sensitive if the API offers a token-based alternative.

Header format

Authorization value
Basic base64(username + ":" + password)

demo:s3cret

The username and password are joined with a colon before UTF-8 Base64 encoding.

Authorization: Basic ZGVtbzpzM2NyZXQ=

Credential string notes

The generated header is just Base64 text for username:password. Treat it like a credential and avoid leaving it visible after copying.

Các Câu Hỏi Thường Gặp (FAQ)

Is Basic Auth secure?

Only when used over HTTPS. The credentials are merely base64-encoded, not encrypted, so anyone who can read the raw request over plain HTTP can recover them instantly.

Does this work with accented letters or emoji in the password?

Yes. The username and password are UTF-8 encoded before being base64-encoded, so any Unicode character is handled correctly.

Where does this header go?

In the Authorization request header, exactly as generated, e.g. Authorization: Basic dXNlcjpwYXNz.

Is Basic Auth encrypted?

No. Basic Auth is only Base64-encoded. It should be used over HTTPS and treated like any other credential.

Công Cụ Liên Quan