[SalesForce] Force.com Site – Custom Forgot Password page not working, throwing unauthorized page error

We have a Force.com site where we enabled login options and for the forgot Password link on the login page settings we have added a custom Forgot Password page.

When I try to navigate to this Forgot Password page(using sites), the page doesn't open and instead it redirects me to an Unauthorized page stating: "Authorization Required ('You must first log in or register before accessing this page)"

  • We have checked site profile settings, security settings and profile
    access for custom Forgot Password page and everything seems ok.
  • Debug logs are not showing anything useful.
  • Cache attribute too is set to false

Any clue or directions here?

Best Answer

This is nearly always down to an exception being thrown, and that can be down to things like field level security.

It seems odd that there's nothing in the logs, you should definitely see an exception there but the things to check are:

  • Permissions for objects used in the controller/page
  • Field Level Security for objects used in the controller/page (so easy to get a null value here and hence a null dereference). FLS for sites is accessed via the site guest profile and isn't listed in the main profile list
  • Check that there's not a redirect happening to a page the guest profile DOESN'T have access to
Related Topic