My problem is this: I'm consuming a WebAPI with the PostAsJsonAsync
method In this call I'm getting a Token for authentication in the ADMIN methods of an EAD platform we're working on.
So far so good. When I call the ADMIN methods by sending the Token returned in the login method, it is returning as "Unauthorized". Here is some of the code that is not working:
response = null;
vAuth_token = retorno.authentication_token;
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("X-Auth-Token", vAuth_token);
response = await client.GetAsync("api/admin/users");
if (response.IsSuccessStatusCode)
{
//HTTP GET
try
{
Usuarios usuarios = await response.Content.ReadAsAsync<Usuarios>();
}
catch (Exception erro)
{
}
}