I created application with Ajax and Odata Services to get/insert/update the data from database.
What i want to check How to set/get HttpContext.Current.User.Identity.Name while login.
Becoz for checking/compare purpose from client side i want to check with the Odata Services.
Public Function OnQueryOrders() As Expression(Of Func(Of CustomersCall, Boolean))
Return Function(c) c.CreatedBy = HttpContext.Current.User.Identity.Name
//c.CreatedBy from DataService to compare with Current user login from client
End Function
Please help on this.
Thanks
Basit.
What i want to check How to set/get HttpContext.Current.User.Identity.Name while login.
Becoz for checking/compare purpose from client side i want to check with the Odata Services.
Public Function OnQueryOrders() As Expression(Of Func(Of CustomersCall, Boolean))
Return Function(c) c.CreatedBy = HttpContext.Current.User.Identity.Name
//c.CreatedBy from DataService to compare with Current user login from client
End Function
Please help on this.
Thanks
Basit.

Blackbarbie Bb56 reputationPosted Sep 2, 2015, 4:07 AM EDT
So on the login, my team would put the IPrincipal (our custom one) here:
And then on in the
we would grab it from the :
and then reattach it to the :
Am I saying "do it exactly like my team did"? Not necessarily. But I'm showing you the 2 places we came across to attach it.
And the hanselman link, which shows some info about it.
http://www.hanselman.com/blog/SystemThreadingThreadCurrentPrincipalVsSystemWebHttpContextCurrentUserOrWhyFormsAuthenticationCanBeSubtle.aspx
Basit KhanRank #4,768 · 326 reputationPosted Sep 2, 2015, 9:29 PM EDT