November 2015
Intermediate to advanced
152 pages
2h 46m
English
To send an authenticated request to ValuesController, we need to pass an access token in the Authorization header. How do we get this access token? To get this access token, we need to log in the application.
Let's first register a user by posting an instance of the user to the Web API Register action method in the Account controller, as follows:

Fig 12 – POSTing an instance of User to Web API
Now, we have a registered user with the username steve@jobs.com and password Password@1. Let's send form with URL encoded data in the request body to the token endpoint, as follows:
{ "grant_type": "password", "username": "steve@jobs.com", ...Read now
Unlock full access