+ Start a Discussion
Jyoti Singh 9Jyoti Singh 9 

Logout user if mobile app not used for one day?

Can I force a user to be logged out if they don't use my app for one day? How and where to specify this setting for Mobile SDK based hybrid apps?
Best Answer chosen by Jyoti Singh 9
Gaurav KheterpalGaurav Kheterpal
You can do this by setting the Access Token policy in the connected app to this setting

Expire refresh token if not used for n. This setting invalidates the token if it is not used for the amount of time specified. For example, if the field value states 7 days, and the refresh token is not exchanged for a new session within seven days, the next attempt to use the token fails. The token expired and can no longer generate new sessions. If the refresh token is successfully used before 7 days, monitoring the period of inactivity resets, and the token is valid for another 7 days.

In your case, set it to 1 day.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Developer Forums Moderator| Dreamforce Speaker