Identity
API authentication
How a program proves who it is to an API: a password on every request (Basic), a token it got once (Bearer), or a key.
API authentication is how a program proves who it is. HTTP Basic sends
Authorization: Basic <base64 of user:password>: not encrypted, so it needs HTTPS. A bearer token is got once
and sent as Authorization: Bearer <token>; it expires, but whoever holds it gets in. An API key is a long-lived
secret in a header. 401 means the server does not know who is asking, 403 that it refuses.
Read next
- Authentication and authorization Authentication proves who is asking; authorization decides what that identity may do.
- REST API An HTTP interface where every thing is a URL and the methods are the verbs: GET reads, POST creates, PUT and PATCH change, DELETE removes.
- TLS and certificates Encryption plus proof of identity: the server shows a certificate for the name, signed by a trusted authority.