Toolvito

Works on this device

Basic Auth Header Generator

Type a user name and a password to get the Authorization header of HTTP Basic authentication, or paste a header to read the user name back. The header is made in this page; the password is masked and is not sent or saved.

Make or read a header

Gives the Authorization header that sends this user name and password with HTTP Basic authentication.

User name and password

Exactly as the server knows it. It may not hold a colon (:).

Or an API key or token that the service takes as the password. It is masked, is not sent or saved, and the result does not show it.

More options

Matters only for letters outside A to Z, such as é or ü. Ask the service which one it reads.

RFC 7617 section 2.1 asks for this step (part of the rules of RFC 7613) when UTF-8 is used. It changes only letters that can be typed in two ways, such as é.

The header is made in this page. The password is not sent or saved.

The header will show here

Type a user name and a password, or choose Try an example.

How to use the Basic auth header generator

  1. Choose Make a Basic auth header and type the user name and the password. The header follows as you type.
  2. Copy the whole header line, the value that starts with Basic, or only the Base64 part, whichever your program asks for.
  3. If the user name or password has letters outside A to Z, such as é or ü, check the character encoding under More options.
  4. To read a header, choose Read a Basic auth header back and paste it. The password is shown only if you tick Show the password in the result.

How the header is made

Authorization: Basic followed by the Base64 of the user name, a colon and the password (RFC 7617, section 2). Base64 is the standard form of RFC 4648 with = padding at the end.

The user name may not hold a colon, because the first colon ends it. The password may hold colons. Neither may hold control characters such as a tab or a line break.

RFC 7617 does not fix how letters outside ASCII become bytes. A server can ask for UTF-8 with charset="UTF-8"; older servers often read ISO-8859-1 (Latin-1). For plain A to Z, digits and keyboard signs both give the same header.

With UTF-8, RFC 7617 section 2.1 asks the client to prepare the text by the rules of RFC 7613. Their Unicode NFC step is offered under More options; the other rules of RFC 7613 are not applied.

The header is a secret

  • Base64 is an encoding, not encryption. Anyone who sees the header can turn it back into the user name and the password in a second, as the second mode of this tool does.
  • Send Basic auth only over HTTPS. Over plain HTTP the password can be read on the way (RFC 7617, section 4).
  • This page has no save option and no CSV file. The password box is masked, and the result gives only the length of the password. The header itself is shown so that you can copy it: clear the page when you are done.

Worked examples

RFC 7617 gives the example user Aladdin with the password open sesame. Aladdin:open sesame has 19 bytes, and its Base64 is QWxhZGRpbjpvcGVuIHNlc2FtZQ==, so the header is Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==.

Its second example is the user test with the password 123£. In UTF-8 the pound sign is 2 bytes (C2 A3), and the header is Authorization: Basic dGVzdDoxMjPCow==. In ISO-8859-1 it is 1 byte (A3), and the header is Authorization: Basic dGVzdDoxMjOj.

Limits you should know

  • The tool makes and reads the header only. It does not send a request and cannot tell whether a server accepts the user name and password.
  • It does not apply all the rules of RFC 7613 (width mapping of user names, mapping of spaces in passwords); only the optional NFC step.
  • Other schemes such as Bearer or Digest are not Basic: they hold no user name and password to read back.

Related tools