DemoUserAuthorization
DemoUserAuthorization copied to clipboard
Request.Headers.Authorization is null.
int the method "OnActionExecuting", Request.Headers.Authorization is always null, I don't know how to set it and I find you setting the code "ticString " [string ticString = FormsAuthentication.Encrypt(ticket);] into cookie.
Hi, in my project, I use ajax to make a web request in browser side, so I use cookie to storage the encrypted authorization. Maybe it's better to use web local storage when HTML5 is a choice.
There is a sample code to set authorization in web request header, hope it's a tip for you.
request.Headers.Add("Authorization", "BASIC " + "encrypted authorization..." );
//you need to package your authorization info here.
I think the popular solution is HMAC, you can get more if you search in google,
I was able to do it. thanks for your reply.