I have a Web Api 2 project based on SPA VS 2013 Template. I have a bearer token authentication configured in that Api.
I also have a separate MVC 5 project, I want to authenticate using that Web Api. Is that possible? How?
What I did so far (in my Mvc Client) :
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://localhost/MyApi/");
var response = client.PostAsync("Token", new StringContent("grant_type=password&username=teste&password=123456", Encoding.UTF8)).Result;
if (response.IsSuccessStatusCode)
{
//
}
}
It got the Token, but what now?