Sobes.tech
Junior

How does data transfer work when using Basic Authentication?

sobes.tech AI

Answer from AI

In Basic Authentication, the client sends a request with an HTTP header Authorization, the value of which starts with Basic , followed by a Base64-encoded string. This string is formed by concatenating the username and password, separated by a colon (username:password). The server decodes this string, extracts the username and password, and then compares them with the credentials stored in its system for authentication.

GET /protected/resource HTTP/1.1
Host: example.com
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=  // dXNlcm5hbWU6cGFzc3dvcmQ= is the Base64 encoding of the string "username:password"