I download [Thinktecture.IdentityServer.v3][1]
and the corresponding clients projects. I want to check the user role in the SampleAspNetWebApi
project.
So i change the sample method as follows
[Authorize(Roles="Admin")]
public class IdentityController : ApiController
{
public dynamic Get()
{
var principal = User as ClaimsPrincipal;
return from c in principal.Identities.First().Claims
select new
{
c.Type,
c.Value
};
}
}
I use the WPF hybrid client
to Call the service and use alice
user that has the Admin
role.
But it returns UnAuthorized error.
The user is authenticated but the role is not set.
How can i check the user role in SampleAspNetWebApi project?