0

I am using visual studios default web api 2 template.

I have successfully got it to register users:

http://localhost:49913/api/Account/Register
{
  "Email": "testuser@gmail.com",
  "Password": "Password123!",
  "ConfirmPassword": "Password123!"
}

And I can even grab the token.

http://localhost:57555/token
{
    "access_token": "8gRwMCGCPvw_zCn28023......",
    "token_type": "bearer",
    "expires_in": 1209599,
    "userName": "testuser@gmail.com",
    ".issued": "Mon, 26 May 2014 16:22:17 GMT",
    ".expires": "Mon, 09 Jun 2014 16:22:17 GMT"
}

How on earth though do I use user roles. I see it generates a table in the db but I can't seem to figure out what to do to make it do roles. Is there any tutorial on this that anyone could please share?

allencoded
  • 7,015
  • 17
  • 72
  • 126
  • possible duplicate of [How to create roles and add users to roles in ASP.NET MVC Web API](http://stackoverflow.com/questions/21734345/how-to-create-roles-and-add-users-to-roles-in-asp-net-mvc-web-api) – ptfaulkner May 27 '14 at 16:59
  • I take it .NET doesn't make this easy as to do. The duplicate posted above doesn't help. I have asked for more information or a template. Does anyone know any alternative web api templates? – allencoded May 27 '14 at 21:00

0 Answers0