Monday, June 6, 2011

Good check list for Sites page getting "Authentication Required"

I was researching the issue and found this good check list on this thread (actually mentioned by the asker), which helped me to pinpoint the cause.  The discussion thread was about, and eventually solved by something else...  but still want to thank for the valuable background information provided.  So, in short, if you encounter "Authentication Required" when trying to access a Force.com Sites page, you should check:

  • The object in question (used by the Standard Controller, for instance) has read, create, and edit checked for the guest user
  • The field level security is set to Read Only at least (or better, Edit if allowed) for everything accessed
  • The guest user has access to VF Pages used
  • The guest user has access to Apex classes used (direct or indirectly called)
  • There are no relationship fields on the custom object
  • The Controller is not using "with sharing" modifier
  • Any error that may be caused by the page, since if there's an error, you get hit with the same "Authentication Required" page.