I currently have one IoT device updating data on Salesforce and it is using Salesforce Connected App and the Web Server OAuth2 Authentication Flow. Currently, there is two users created:
- Administrator user account, which is used to login to administer (create connected app and Salesforce settings) and to get a token for the IoT device.
- A user account to just login to the front end application to see the data.
On the IoT device, to get it to connect to Salesforce Connected App I perform the following:
- Use a third party tool, like Postman, to get an access token. Login with administrator user
- Copy the access token, refresh token, consumer key, & consumer secret values to the IoT device.
- Start the IoT device and have send API request to the cloud.
- When the token expires and get "invalid session" there is source code that will automatically get a new token/refresh token.
Now, at this point this works great, but I’d like to connect many IoT device and have them upload data to Salesforce. In this case would I setup multiple accounts one for each IoT device so that a different token is used to each device and can be revoked if needed?
What is the best practices used for this type of scenario?