+ Start a Discussion
Snehil KarnSnehil Karn 

Visualforce login flow error - Can't Display Page

I am trying to implement an intermidiary page which will display after login but before landing on the home page. I am using visualforce login flow for that. I tried the example provided in salesforce help page

https://dreamevent.secure.force.com/articleView?id=security_login_flow_visualforce.htm&type=0

However when I login with the user, it shows the following error and the user is stuck here itself. I do not understand what wrong I am doing:

User-added image

Here are the code snippets:
VF Page
<apex:page showHeader="false" controller="VFLoginFlowController">
  <h1>You are in VF Login Flow</h1>
  <apex:form >
    <apex:commandButton action="{!FinishLoginFlowHome}" value="Finish and Go to Home"/>
    <apex:commandButton action="{!FinishLoginFlowStartUrl}" value="Finish and Go to StartUrl"/>
  </apex:form>
</apex:page>

Controller
public class VFLoginFlowController {

    public PageReference FinishLoginFlowStartUrl() {
        //do stuff
        
        //finish the login flow and send you to the startUrl (account page in this case)
        return Auth.SessionManagement.finishLoginFlow('/001');
    }


    public PageReference FinishLoginFlowHome() {
        //do stuff
        
        //finish the login flow and send you the default homepage
        return Auth.SessionManagement.finishLoginFlow();
    }
}

 
Raj VakatiRaj Vakati
 To resolve it I used the Force.com IDE. Just log into the environment and download 'something' (report, apex, the flow etc) and once it's down, right click on it and hover over the force.com option and click on 'Show in Salesforce Web'. This will bypass the login flow and allow you to move about your instance as per normal and edit/deactive the flow.

https://success.salesforce.com/answers?id=90630000000DESMAA4
Snehil KarnSnehil Karn
Hi Raj,

Thanks for your response. I am not stuck or locked out. I have to implement a login flow using VF page. I am trying to implement that but instead of that page showing, I see the error page as shown in the description. I am looking for a solution for that issue.
VSK98VSK98
Hi Snehil,

Have you fixed this issue?

Thanks,
VSK98