I have a hybrid remote app that uses a custom login page to authenticate through customer portal and land on a custom VF page. This works fine, however if the user resets their password they get stuck in a loop on the custom login page (login and return to login page).
If they get stuck in the loop and shut down the app and then restart it they're able to login fine. It feels like its losing the startURL parameter that comes from the app on load during the password reset process.
Here's my best guess of the flow that is going on:
successful login flow:
- App loads custom login page using
sfdcoauthloginhost
parameter in the app's.plist
file - The custom login page is loaded with a startURL parameter
/mobile/setup/secur/RemoteAccessAuthorizationPage.apexp?source==LONGSTRINGOFCHARS
- It then fires login which goes to :
https://MYSITE.cs15.force.com/mobile/secur/frontdoor.jsp?LOTSOFURLPARAMS
- It then uses the startPage property of
bootconfig.json
to somehow redirect it to the correct VF landing page upon successful login?
Reset password flow
- the same
- the same
- user clicks reset password
- they enter their username and confirm reset
- they are told their new password has been emailed to them and click to return to login page
- the login page at this point has seemingly lost the original startURL parameter
- they login and create their new password and are returned to the login page
- they login using their new password and are stuck in a loop since there is no startURL parameter
Can anyone provide clarification around how this flow actually works and any ideas on how to solve the loop after resetting password would be great!
Login controller for reference:
public Ctl_MobileLogin () {
startURL = System.currentPageReference().getParameters().get('startURL');
}
public PageReference login() {
return Site.login(username, password,startURL);
}
Thanks in advance!