You need to sign in to do that
Don't have an account?
VSK98
Getting error while passing the dynamic url into Auth.SessionManagement.finishLoginFlow
Hello All,
I'm trying to pass the dynamic url into Auth.SessionManagement.finishLoginFlow as i'm getting the error. Please find the snippet code below.
Apex:
Error:
I was hiting the url like this "https://*****.my.salesforce.com/001/o"
please share your thoughts....
Thanks,
VSK98
I'm trying to pass the dynamic url into Auth.SessionManagement.finishLoginFlow as i'm getting the error. Please find the snippet code below.
Apex:
public class VisualFlow { public PageReference getFinishPage() { // Get the query string of the current request. System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery()); string retUrl = URL.getCurrentRequestUrl().getQuery(); if(retURL == 'retURL=%2Fhome%2Fhome.jsp'){ return Auth.SessionManagement.finishLoginFlow('/home/home.jsp'); } else { retURL = retURL.removeStart('retURL='); system.debug('retURL####'+retURL); return Auth.SessionManagement.finishLoginFlow(retUrl); ------- Getting error } } }
Error:
System.NoAccessException: Invalid Page Redirection: The page you attempted to access has been blocked due to a redirection to an outside website or an improperly coded link or button. Please contact your salesforce.com Administrator for assistance.
I was hiting the url like this "https://*****.my.salesforce.com/001/o"
please share your thoughts....
Thanks,
VSK98
Review below link and update VF accordingly.
https://trailblazers.salesforce.com/answers?id=9063A000000pc9VQAQ
Thanks,