Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 04, 2013 02:17 AM by BrockAllen
Member
9 Points
11 Posts
Dec 26, 2012 08:00 AM|LINK
How to debug Web API controller method with [Authorize] attribute in fiddler?
Adding "Authorization: Basic xxxxxxxxxx" to the HTTP head also get a response code of 401.
So how to debug API controller method with [Authorize] attribute in fiddler?
And also, to call API controller method with [Authorize] from embedded client? Is there a best practice?
All-Star
28084 Points
4997 Posts
MVP
Dec 26, 2012 03:26 PM|LINK
It sounds like you're debugging directly from fiddler (rather than some client code you've written). So either remove the attribute while testing (assuming you're on a dev box) or you'll need to pass a valid authorization header.
Jan 04, 2013 02:11 AM|LINK
Some resources are user-specificed, so remove [Authorize] may cause User.Identity, etc., empty.
How to build a valid authorization header? Is there a guide? I think it is a common scene.
Jan 04, 2013 02:17 AM|LINK
I'd suggest watching this video on securing WebAPI:
http://vimeo.com/43603474
VictorWoo
Member
9 Points
11 Posts
How to debug method with [Authorize] attribute in fiddler?
Dec 26, 2012 08:00 AM|LINK
How to debug Web API controller method with [Authorize] attribute in fiddler?
Adding "Authorization: Basic xxxxxxxxxx" to the HTTP head also get a response code of 401.
So how to debug API controller method with [Authorize] attribute in fiddler?
And also, to call API controller method with [Authorize] from embedded client? Is there a best practice?
BrockAllen
All-Star
28084 Points
4997 Posts
MVP
Re: How to debug method with [Authorize] attribute in fiddler?
Dec 26, 2012 03:26 PM|LINK
It sounds like you're debugging directly from fiddler (rather than some client code you've written). So either remove the attribute while testing (assuming you're on a dev box) or you'll need to pass a valid authorization header.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
VictorWoo
Member
9 Points
11 Posts
Re: How to debug method with [Authorize] attribute in fiddler?
Jan 04, 2013 02:11 AM|LINK
Some resources are user-specificed, so remove [Authorize] may cause User.Identity, etc., empty.
How to build a valid authorization header? Is there a guide? I think it is a common scene.
BrockAllen
All-Star
28084 Points
4997 Posts
MVP
Re: How to debug method with [Authorize] attribute in fiddler?
Jan 04, 2013 02:17 AM|LINK
I'd suggest watching this video on securing WebAPI:
http://vimeo.com/43603474
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/