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
Sowmya M NSowmya M N 

After the session time, user is unable to login into the hybrid remote application

Hi All,

We have built the Hybrid Remote App.  When the application is idle and session timeout user is unable to login. On providing the correct crededntials also its redirecting back to login page and no error message is displayed. After reinstalling the app only user is able to login. We have not created any custom login. Salesforce Mobile SDK 6.0 default login is only used.

Following is the bootconfig file content.
{
  "remoteAccessConsumerKey": "XXXXXXXXXXXXXXX",
  "oauthRedirectURI": "https://login.salesforce.com/services/oauth2/success",
  "oauthScopes": [
    "web",
    "api"
  ],
  "isLocal": true,
  "startPage": "/apex/XXXXxxxxxxXXXXX",
  "errorPage": "error.html",
  "shouldAuthenticate": true,
  "attemptOfflineLoad": false
}

Steps followed to create the hybrid remote app
1. forcehybrid create command
2. Using statis resource for for library files, images, styles
3. Visualforce file for frontend content
4. Updated consumerkey and 'start page' in bootconfig

Request you to let me know if any other configuration changes needs to be done.

Thank You.

- Sowmya
SandhyaSandhya (Salesforce Developers) 
Hi,

Did you refer below link for similar discussion. You have to use authenticate and logout methods.

https://github.com/forcedotcom/SalesforceMobileSDK-Android/issues/1271
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 
Sandip JanaSandip Jana
Hi Sandhya,

There is not proper solutions for the url you maintioned and after adding cordova also we are not able to call authenticate function from com.salesforce.plugin.oauth. 

Thanks,
Sandip
Sowmya M NSowmya M N
@Sandhya,
After adding Cordova logout method on logout. Logout is working.
On session timeout and on relaunching the app, login screen opens and unable to login. Where can we call cordova logout method in this scenario.
Sowmya M NSowmya M N
We fixed the session timeout issue by calling salesforce logout if session id is available else we are redirecting to login screen. Could anyone please let us know if this is the correct approach.

var sid= '{!$Api.Session_ID}';
if(sid!="NULL_SESSION_ID"){
window.open('https://xxx-xx-xxx.com/secur/logout.jsp', "_self");
}else{
window.location='https://xxx-xx-xxx.com/login';
}