function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kshannonkshannon 

Can you use a Static Security Token/Password for PHP API Calls?

Hey All,

 

We are pulling event information from our Salesforce onto our website with an API call through PHP.

This call requires Username, Password, and Security Token (obviously). The only issue with this is that passwords are forced to change and the security token changes as well.

Is there anyway to set this up statically so that it will not need to be adjusted every approx 6 months?

 

Thanks,

Kyle

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

Yes, access_token & sessionId are the same thing and are interchangable, I think this is called out in the oauth docs.

All Answers

SuperfellSuperfell

You could do a one time run through the oauth flow to get a refresh token, which won't change based on password changes, or you can create a custom profile and turn on the password never expires flag.

Park Walker (TAGL)Park Walker (TAGL)

Simon,

 

Just to be clear, are you saying that the oauth token can be used with the Web Services API as well as with the Rest API? I cannot see any references to this in the documentation nor does there seem to be an authorization header that can be used. If you have a pointer to any documentation it would be helpful.

 

Thanks,

Park

SuperfellSuperfell

Yes, access_token & sessionId are the same thing and are interchangable, I think this is called out in the oauth docs.

This was selected as the best answer