+ Start a Discussion
Muhammad SabirMuhammad Sabir 

Hybrid App goes to SF website after login

When there is a successful login after a failed one, Salesforce mobile SDK takes the user to salesforce website instead of launching mobile app page. Its an hybrid app built using cordova and SF Mobile SDK. Login is performed by SDK. Anyone having same issues?
Gaurav KheterpalGaurav Kheterpal
Check the callback URL in the connected app that you created. If you did not create a connected app, you should do so by Create -> Apps -> Connected Apps
This will return a client id and secret.

Check the values for callback URL, client id and secret in
www/bootconfig.json in your hybrid app code
Muhammad SabirMuhammad Sabir
Thanks for taking time and the reply. We actually have completed the development and everything is in place. It works fine after successful log in. In fact app is production ready. Only problem we have is that, if for some reason login attempt fails and then retry succeeds, it redirects to the SF main web page. This bug is kind of odd and looks like SF SDK is not looking at the client type and redirect URL in this scenario, and treating the client request as normal web request.
I appreciate any help in this regard.
akhilesh_sfdcakhilesh_sfdc
Muhammand, are you using communities for use authentication?
Muhammad SabirMuhammad Sabir
No. All logins are internal.
akhilesh_sfdcakhilesh_sfdc
Which version of SDK are you using and is it iOS/Android? Are you able to reproduce this issue with an existing SDK sample apps? It will be useful if you can share the runtime logs from Xcode or Eclipse to debug the issue.
Gaurav KheterpalGaurav Kheterpal
I've seen this in the past with SDK 2.x versions but no longer able to reproduce it on 3.1. If you are not using the latest SDK version, I'd strongly recommend upgrading to 3.1

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.