{
    "content": "<h1>Bearer Tokens in API Authentication<\/h1><p>A <a href=\"..\/Bearer-Token\/\">Bearer-Token<\/a> is a security credential that grants access to a protected resource to anyone who presents the token. In modern <a href=\"..\/Web-Development\/\">Web-Development<\/a>, these tokens are the standard mechanism for implementing <a href=\"..\/Authentication\/\">Authentication<\/a> and <a href=\"..\/Authorization\/\">Authorization<\/a> within the <a href=\"..\/OAuth-2.0\/\">OAuth-2.0<\/a> framework. The name implies that the 'bearer' of the token is authorized to access resources, much like a physical key or a ticket.<\/p><p>As defined in the official specification <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc6750\">RFC 6750<\/a>, the token is typically transmitted in the <a href=\"..\/HTTP-Header\/\">HTTP-Header<\/a> of a <a href=\"..\/REST-API\/\">REST-API<\/a> request. The standard format uses the <code>Authorization<\/code> header with the <code>Bearer<\/code> scheme (e.g., <code>Authorization: Bearer [TOKEN]<\/code>). Because any party in possession of the token can use it, it is mandatory to use <a href=\"..\/Transport-Layer-Security\/\">Transport-Layer-Security<\/a> (TLS) and <a href=\"..\/HTTPS\/\">HTTPS<\/a> to prevent interception by malicious actors.<\/p><p>Many implementations use the <a href=\"..\/JSON-Web-Token\/\">JSON-Web-Token<\/a> (JWT) format for these tokens. This allows the <a href=\"..\/Resource-Server\/\">Resource-Server<\/a> to verify the token's integrity and extract claims—such as user identity and permissions—without needing to perform a database lookup for every request. This stateless approach is particularly beneficial for <a href=\"..\/Microservices\/\">Microservices<\/a> architectures where scalability is a priority. Proper management of <a href=\"..\/API-Security\/\">API-Security<\/a> also involves implementing token expiration and using <a href=\"..\/Refresh-Tokens\/\">Refresh-Tokens<\/a> to mitigate the risks associated with stolen bearer credentials.<\/p><ul><li><a href=\"..\/OAuth-2.0\/\">OAuth-2.0<\/a><\/li><li><a href=\"..\/JSON-Web-Token\/\">JSON-Web-Token<\/a><\/li><li><a href=\"..\/API-Security\/\">API-Security<\/a><\/li><li><a href=\"..\/Access-Token\/\">Access-Token<\/a><\/li><\/ul>",
    "tags": [
        "api",
        "security",
        "bearer-token",
        "oauth2",
        "jwt",
        "authentication",
        "authorization",
        "rest",
        "web-security",
        "identity"
    ]
}