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.
Basit KhanPosted Sep 3, 2015, 1:29 AM
Blackbarbie BbPosted Sep 2, 2015, 8:07 AM
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