+ Start a Discussion
jthor@entransform.comjthor@entransform.com 

Change login page for mobile SDK

Hello folks,

  

      I was wondering if there was a way for me to change the login site from the standard saleforce login to a custom login page I created. I tried modifying the production url in server.xml which is suppose to be use to access a custom server and the production login url in  the loginservermanager.java in the Mobile sdk itself. When I do that it throws a null error when trying to install the apk. Is there a proper way for me to change the login page or at least make my custom page the first thing in the app before logging into salesforce?

 

Thanks in adavance for any replies or views. 

jthor@entransform.comjthor@entransform.com

After some more research I would liek to know if I could change the default salesforce login to my own force.com site?

Gaurav KheterpalGaurav Kheterpal

You can redirect it to any page using the approach mentioned here

 

http://brianpeddle.com/2011/06/06/building-a-custom-salesforce-login/

https://github.com/BPeddle/SFDC.Custom.Login

 

I hope this helps.

 

Regards,

Gaurav

jthor@entransform.comjthor@entransform.com

Oh yes thanks for the link, but I saw this before while I was looking for an answer. The problem is to get the SDK to go to that site page. That is where I am stuck. I tried changing the the hardcoded url in the SDK to a different site but is did not work.

Gaurav KheterpalGaurav Kheterpal

Have you tried overriding the getLoginURL() method in LoginActivity class? That should do the trick.

 

http://forcedotcom.github.com/SalesforceMobileSDK-Android/com/salesforce/androidsdk/ui/LoginActivity.html#getLoginUrl()

 

Regards,
Gaurav

jthor@entransform.comjthor@entransform.com
Wow how did you find this? Thank you so much.
Gaurav KheterpalGaurav Kheterpal

If that worked, can you please mark the question as solved.

 

Thanks!

Gaurav

jthor@entransform.comjthor@entransform.com

Hey I kow it been awhile, I've been working on some other stuff. But getLoginURL does not seem to be there. I tried changing the production URL in server.xml, and in LoginServerManager.java as well as changing it in loadingLoginPage in LoginActivity. It does not seem to be working right now I think I am going to experiment with CustomServerUrlEditor and see where that takes me.

Mina Zaklama 9Mina Zaklama 9
Have you found a solution for how to create your own custom login page in the mobile app ??