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
Yehiel Zafrany 7Yehiel Zafrany 7 

Users logged in with mobile SDK, must login again frequently

We have multiple users that must login again even if they have a valid refesh token in salesforce.
The token was not revoked.

Why do they have to login again ?
How can we investigate to figure out what is the reason for this ?
Yehiel Zafrany 7Yehiel Zafrany 7
Up
Steve ThistleSteve Thistle
Hi Yehiel, 

Can you provide any more info on what is happening in your case? Are you using ios or android? I use the mobile sdk on android without this issue.

Suggest checking your connected app settings for Session policies and Oauth as a starting point. Note that even if your app doesnt set Session policies your org may enforce them. 

"Session Timeout Value—Specifies when access tokens expire to end a user’s connected app session. You can control how long a user’s session lasts by setting the timeout value for the connected app, user profile, or org’s session settings (in that order). If you don’t set a value or None is selected (the default), Salesforce uses the timeout value in the user’s profile. If the profile doesn’t specify a timeout value, Salesforce uses the timeout value in the org’s Session Settings."

See https://help.salesforce.com/articleView?id=connected_app_manage_edit.htm&type=0&language=en_US and https://help.salesforce.com/articleView?id=admin_sessions.htm&type=0
Yehiel Zafrany 7Yehiel Zafrany 7

We use IOS.

We have checked the session settings for the connected app, we have the following:

  • Connected app level - none
  • Profile level - 8 Hours
  • Org level - 8 Hours
User-added image

It happens on random profiles/users, we couldn't identify an identical behavior based on a specific criteria...