How many "s"s can you find in:
Q: Verify SharePoint user in ajax request Consider the following: A logged-in user visits a publishing page in a SharePoint Online environment. The page loads data from a service running on another server using an ajax request. 
In this scenario, how do I, as an author of the service, make sure the user making the request is who he says he is? Can I use any data in the request to check back with the SharePoint site that there's a valid session for the given user?
EDIT:
To further elaborate: on the server side, in my custom service, I will get a request initiated on the client side of a sharepoint online site. How do I, as an author of that custom service, determine if the request comes from a valid user? I mean, anyone can fire up the javascript console in their browser and issue an ajax request to my service, pretending to be whoever.

A: if you are SharePoint online, i would suggest that you leverage the AppModel. 


*

*Register an App Id and App Secret.

*Have your service build a context to SharePoint.


*

*You can use the SharePoint Web Toolkit to build a context to SharePoint in .NET.


*Using the Client Side Object Model (CSOM), request the current user information from SharePoint Online.
You can do this from non-Microsoft technologies and/or from the browser even. Hope this helps.

A: Using SPServices is easier. 
 $().SPServices.SPGetCurrentUser({
   webURL: "",      // Added in 2013.01
   fieldName: "Name",
   fieldNames: {},      // Added in v0.7.2 to allow multiple columns
   debug: false
});

http://spservices.codeplex.com/wikipage?title=%24().SPServices.SPGetCurrentUser

A: the user would be belong to a group to access the site so verify if the user have been included to any of the group using sp services the below code would help
var selector = 'Group[ID=\'' + GroupId+ '\']';
$().SPServices({
    operation: "GetGroupCollectionFromUser",
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
    completefunc: function(xData, Status) {
        if($(xData.responseXML).find(selector).length == 1) {
            result = true;
    }
  }   });

pass the group id of sharepoint in the Place of GropuId parameter, you can find the id of group by opening the group the id would be  there in the url 

user
In the text, there are 131 "s"s.
assistant