2

In my ASP.Net Web API Project, i added [Authorize] attribute to the controller. So when i call the method it is returning error as

"Message": "Authorization has been denied for this request."

How to send Authorize Headers along with my request.

Controller

[Authorize]
[HttpPost]
public HttpResponseMessage Settings(SettingModel data)
{
    --Do i need to check authorize headers manually here?
    --code goes here
}

Here it is called

http://localhost/sample/api/Settings

Headers
{
   Content-Type: application/json
   Authorization: What value need to be send here?
}
Darrel Miller
  • 139,164
  • 32
  • 194
  • 243

1 Answers1

0

check the answers of Darin : How to do role based authorization for asp.net mvc 4 web api

I guess you need to register the handler..

Community
  • 1
  • 1
mmssaann
  • 1,507
  • 6
  • 27
  • 55
  • I think u posted different answer. I just need here is token based authorization. Something token i need to issue on login and the subsequent request must include that token... –  Jun 20 '13 at 04:49