Had a question regarding session timeouts, renewals and renewing a security token using a connected app and the salesforce API.
We have an Azure function that acts as a mediator to pass data between our on-premise services and salesforce lightning instance. At the beginning of each request to the Azure Function, we send a request to the server using the client secret, password and other information and successfully receive our access token. However, we are seeing the INVALID_SESSION_ID after a certain period of time (usually in the morning)
I'm really new to connected apps and Salesforce as a whole so I wanted to learn more about why this is happening and what I can do to prevent it. This app on the cloud and is only used internally, so we are not worried about logging it out at all. We want it to stay active as long as the service is active, which should be all the time with the exception of maintenance.
Now for my laundry list of questions
Our token does not appear to change during testing after certain period of time. When I am debugging I will successfully get the request token, then try again about 20-30 minutes later and the token will be the exact same. **Should this token change since I am making a new authorization request each time? I have a hunch that our session is expiring because of inactivity but I'm curious as to why the Token is always the same. **
Seeing how this is an integration account, I do not want the session to expire. What makes a session expire? Does it have anything to do with this value on our connected app itself?
- The Updated By and Valid Until sections in Session Management are constantly updating. The Valid Until is always set to 2 hours after the Updated section. How are these values getting set? Are these something I can control?
Thank you all for the help in advance from a Salesforce Rookie!