When the Guest User for my account tries to submit a form it is told that authorization is required and they must login. When I set up a debug log for that user a bug logged with these details and I don't know what any of it means!


21:47:48.019 (19944087)|EXECUTION_STARTED

21:47:48.019 (19969929)|CODE_UNIT_STARTED|[EXTERNAL]|066d0000001NshO|VF: /apex/Unauthorized

21:47:48.078 (78932209)|CUMULATIVE_LIMIT_USAGE

21:47:48.078 (78932209)|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 0 out of 100

Number of query rows: 0 out of 50000

Number of SOSL queries: 0 out of 20

Number of DML statements: 0 out of 150

Number of DML rows: 0 out of 10000

Maximum CPU time: 0 out of 10000

Maximum heap size: 0 out of 6000000

Number of callouts: 0 out of 100

Number of Email Invocations: 0 out of 10

Number of future calls: 0 out of 50

Number of queueable jobs added to the queue: 0 out of 50

Number of Mobile Apex push calls: 0 out of 10

21:47:48.078 (78932209)|CUMULATIVE_LIMIT_USAGE_END

21:47:48.078 (78980608)|CODE_UNIT_FINISHED|VF: /apex/Unauthorized 21:47:48.080 (80157510)|EXECUTION_FINISHED


Go to the Site settings (Develop->Sites->Name of Site), then click on the "Public Access Settings".

This will take you to the profile for the guest user (which is used for anyone accessing your Site without logging in).

That profile will need to have permission for all of the VF Pages, Apex Classes, and Objects involved in the form submission i.e. if your form submission stores data into any object, the profile must have create-access on that object.

| improve this answer | |

If you add the <site:previewAsAdmin /> tag to your site template, then visit Develop > Sites > Name of Site > Preview as Admin you will be able to see on-screen error messages that would otherwise not be visible to your end users. This can greatly speed up your debug time.

More info on the tag is available in the Visualforce Docs: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_site_previewAsAdmin.htm

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.