function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
iolblurriolblurr 

Customer Portal - Redirect to login

Hi, I have a customer portal set up which allows users to log in and view cases, etc.

 

If a user was to navigate directly to the cases vf page, they immediately get the Salesforce default Authorization Required page that says:  "You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it. "

 

I know this page is usually displayed when there is an error, but there is no error.  I would like the page to redirect to the login page if the user is not logged in.  So lets say I have 2 pages:

1.  Login page

2.  Cases page

 

The default web address brings you to the Login page.  Once you log in, it takes you to the Cases page.  This all currently works fine.

 

But if a user goes straight to the cases page, it SHOULD automatically redirect them to the login page. But instead it brings them to the Authorization Required page. 

 

I dont see any way to do this.....???  How do I override this Authorization Required page?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Vinita_SFDCVinita_SFDC

Hello,

 

It seems you are using sites, if yes then in sites under "Error Page" related list click Page Assignment and you can assign site login page to "Authorization Required Page".

 

Hope this helps!

All Answers

Vinita_SFDCVinita_SFDC

Hello,

 

It seems you are using sites, if yes then in sites under "Error Page" related list click Page Assignment and you can assign site login page to "Authorization Required Page".

 

Hope this helps!

This was selected as the best answer
iolblurriolblurr

thanks this is exactly what I needed!!

lurkerlurker

The problem is that it fixes just that page. If you want to go to 'Forgot Password' you hit the Unauthorized page yet again.

 

Marking this as a solution is a bit disingenuous.