Search code examples
web-servicessalesforceapex-code

Salesforce.com finding a user ID from authentication token


I am implementing a method that receive an authentication token from a user. Based on that token, how can I get the ID of the user that owns the token? The method is being called by an iPhone application. Here is the method declarartion:

global static void getItems(String authToken) 

Thanks.


Solution

  • If you are able to call the REST api's discovery service @superfell provided a great answer that should allow you to solve your problem:

    How to tell if instance specfic Salesforce URL is from Sandbox or Production?