Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the "Bearer" Authorization header have any special meaning?

Tags:

http

header

oauth

Is there a difference between using a "Bearer" Authorization header and using a custom header? For example, the "Basic" Authorization header is different from a custom header because browsers treat "Basic" Authorization headers as a special case (some browsers cache the "Basic" Authorization header). In other words, is "Bearer" just an arbitrary string or do browsers know about it?

If I don't want future browsers to cache my bearer token, should I be safe and use a custom header?

For example, is there a difference between these (assuming my server can handle both):

header('Authorization: Bearer 12345');
header('Mysite-Bearer-Token: 12345');
like image 665
Leo Jiang Avatar asked Mar 09 '16 01:03

Leo Jiang


People also ask

What is the use of bearer in Authorization header?

This is a single string which acts as the authentication of the API request, sent in an HTTP “Authorization” header. The string is meaningless to clients using it, and may be of varying lengths. Bearer tokens are a much simpler way of making API requests, since they don't require cryptographic signing of each request.

What is the use of Authorization header?

The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a protected resource. The Authorization header is usually, but not always, sent after the user agent first attempts to request a protected resource without credentials.

What does bearer mean in authentication?

The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request.

How does Authorization bearer work?

The Bearer Token is created for you by the Authentication server. When a user authenticates your application (client) the authentication server then goes and generates for you a Token. Bearer Tokens are the predominant type of access token used with OAuth 2.0.


1 Answers

Bearer token is defined by OAuth 2.0. You can get more details from https://www.rfc-editor.org/rfc/rfc6750.

like image 57
Kaneg Avatar answered Nov 15 '22 03:11

Kaneg