Перейти к основному содержимому

Basic Auth Builder & Parser

Разработчику

API docs usually say “authenticate with Basic Auth” and leave it there. It is just `username:password` Base64-encoded into a header — but two things trip people up: non-ASCII credentials must be encoded as UTF-8 (plain `btoa` throws), and a colon inside the password must survive. This page does both directions: gives you a header you can paste into curl, or shows you who is behind a header you found.

Загрузка инструмента…

Как пользоваться

4 шагов
  1. 01

    Build: type `user:pass` and get a full `Authorization: Basic …` line ready for curl's `-H`.

  2. 02

    Parse: switch to Parse header and paste the whole Authorization line or just the Base64 part.

  3. 03

    Passwords containing colons are fine — splitting happens at the first colon, the rest stays in the password.

  4. 04

    Non-ASCII credentials are encoded as UTF-8; if a legacy server expects Latin-1, confirm with the provider.

Technical Notes & Guide

1

Basic Auth without HTTPS is a plaintext password

Base64 is encoding, not encryption: anyone holding the header can read the password back instantly. Over plain HTTP, every proxy, Wi-Fi access point and access log along the way can see it. Always pair Basic Auth with HTTPS, and keep it to server-to-server calls or quick debugging — credentials shipped in front-end code are public.

Частые вопросы

2 вопросов
Q1Can I paste the result straight into curl?

Yes: `curl -H 'Authorization: Basic …' https://api.example.com`. Quote the whole line so the shell does not split it at the space.

Q2Basic Auth or Bearer tokens?

Basic sends credentials on every request, which suits internal tools and service-to-service calls. Public APIs should prefer Bearer/OAuth2 tokens: revocable, scoped, and less damaging when leaked.

Разработчику