Tutorial: Salesforce Registration and OAUTH 2.0

Tutorial: Salesforce Registration and OAUTH 2.0

In order for SuitePOS to work you will need to first create a POS Terminal record using the 'Device Id" of the terminal and allocate it to a POS Settings record (which contains all of the configuration parameters). Once that is complete, you then login/register the app with a valid Salesforce user.  

The OAUTH 2.0 User-Agent Flow is used which involves getting an Authorization Code, getting an Access Token using that Code and then using the Access Token to access the Salesforce data.

STEP 1: Create the POS Terminal Record

The Device Id:

POS Terminal Record:

STEP 2: Register/Login to Salesforce

Select Salesforce:

Login to Salesforce and Grant Access

The App Dynamics and Token Management:

When you first register and have successfully logged into Salesforce, an Authorization Code (15 mins duration) is generated and that is used to obtain the Access Token.  This persists until:
  • The App is Closed
  • A Sync Happens
  • The app is timed out (based off POS Settings)
Once one of these events happen, the app ALWAYS gets a new Access Token based off the Refresh Token (which does not expire).
The Access Token persists for as long as is defined in Session Settings. The default is 2 hrs, but this can be changed up to a max of 24 hrs.

Session Settings:



Refresh Token Duration
The Refresh Token persists per what is defined in the Package. The Connected App, SuitePOS, is current set to NOT expire this token.

POS Settings App Time Out (in seconds)
This must be set to be less than the Access Token duration otherwise the App could throw errors when being used due to a potentially expired Access Token that has not been refreshed. 

POS Settings: