Authorization via token with AngularJS

0

I saw that to set the 'Authorization' field of the header with Angular is used:

$http.defaults.headers.common.Authorization = "Bearer " + token

or

$http.defaults.headers.common.Authorization = "Basic " + token

What's the difference between 'Bearer' and 'Basic'? And why when I go to make the request via Postman I do not have to concatenate the token with either?

    
asked by anonymous 25.10.2016 / 15:38

1 answer

1

Basic authentication and Digest are dedicated to authentication using a "login" and a "password".

Bearer authentication is dedicated to using token to authenticate.

Postman's doubt depends on the form you are authenticating in case Basic does not need to pass a token but in the "Body" of the request it would be necessary to enter the "login" and "password".

    
25.10.2016 / 16:09