I got an access token from Salesforce and now I want to check if it's valid or not. How can I do this?

Updated question.

I have a client application and a server. The client requests an access token and after it gets the token, the client will send that token to server. Now, how can server know that the token is valid or not?

I'm using the Username/Password Flow illustrated in this link.

  • How did you get that access token? Can you please update your question and provide more background? Aug 14 '14 at 3:52
  • Updated question @Bachovski Aug 14 '14 at 4:01
  • Have you read the examples in the SFDC REST Api Developers Guide - they show examples of getting the token and then doing various REST operations
    – cropredy
    Aug 14 '14 at 4:35
  • Are you trying to write a server and connect to it from force.com? If not, and salesforce.com will handle the checking for you. What platform and API are you using?
    – Matt Lacey
    Aug 14 '14 at 4:46
  • Yes, that's what I'm doing. The server was connected to force.com by validate username and password from user then get SFDC sessionID. Now my work is replace username and password by Oauth. @LaceySnr Aug 14 '14 at 6:33

Unless and until you request for new token from Salesforce , older token remains valid.

  • Is that so? Thank you very much. Aug 14 '14 at 7:31
  • 4
    The lifetime of an access token obtained by the above mechanisms is limited to the session timeout configured in Setup ➤ Security Controls ➤ Session Settings.
    – Harshit
    Feb 28 '15 at 19:08
  • 3
    this is true of refresh token not for access token. this Answer is not correct. Mar 16 '17 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.