Call Authenticated – Web API 2
How to call an Authenticated Web Api 2 method
Do a HTTP GET on the this URL
[cc]
http://localhost:15718/api/Account/UserInfo
[/cc]
with the HTTP HEADER
[cc]
Authorization: Bearer zt3Ma_gzOxRi53YgCciMe1H1j6Uss………
[/cc]
The bearer token is from login using http://localhost/token. You can get more information here.
[cc]
You should get a HTTP RESPONSE 200 with following data
[/cc]
[cc]
{
“UserName”:”john”,
“HasRegistered”:true,
“LoginProvider”: null
}
[/cc]
HTTP POST to the URL (Login) – Web API 2 Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10)