• Richard Telford
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1
I've successfully obtained an access token using Web Server OAuth Authentication Flow. I'm just wondering what the best process is in the following instance:

1. Attempt to create a new lead in SalesForce using /sobjects/Lead/. 
2. If access_token is valid, the lead is created successfully.
3. If access_token is invalid, get a new one and go back to step 1?

I can do the above no problem but I was previously using username/password OAuth method and decided I need to be using the Web Server OAuth method.

If the access_token is invalid, do I simply have to obtain a new access_token using grant_type=refresh_token and then go back to step 1?
It feels a bit clunky and I was wondering if there was a way to check if the access_token was valid before even attempting step 1.

Any input appreciated greatly.

I have an application using oAuth for authorization. It's been working fine for months. Over the weekend, issues started happening and after digging into it, it appears that while the authorization is successful (response 200 with valid JSON object returned), we're no longer receiving a refresh token after authorization.


Here is the oAuth request/response:







This request is supposed to return a request_token parameter with the JSON response -- and it *always* has in the past. Docs here: http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com