I am working on an application where certain actions are performed using ajax requests to a backend api page, such as adding likes to content. The javascript function will pass the user ID and content ID to the api page in an xmlhttp request.
We use Forms Authentication with Active Directory.
For obvious reasons, I want to verify that the input I receive on the api page before doing anything at all.
While my web.config makes sure that only logged in users can access the api page, I can't find any way to get the current user's info such as username. I tried the following:
Membership.GetUser().Username;
How do I go about getting the logged in users' information from my page?
thanks