Salesforce Asked by user2610036 on January 20, 2021
I’m currently trying to create a public site but am running into an issue where whenever I try access any data I get the ‘Authorization Required’
A simple test was to create a basic VF page
<apex:page standardController="Account">
{!Account.Name}
</apex:page>
The guest site profile has read write access on the Account object
Every field on Account has its visibility flag ticked
If you visit the page /site/test it shows nothing which is what I would expect
but give it an id /site/test?id= and it shows the ‘Authorization Required’
So right now I am at a loss. I’ve given the site profile all the permissions it needs and the visualforce page is configured correct for the site since you can view the VF page when it is not trying to access an Account.
Is there some config somewhere that I am missing?
The "authentication required" error happens when the site user experiences an error, such as not having permission to a field, a null-pointer exception, etc.
More details can be found here: Debugging Sites Authorization Required Error.
Answered by Jorge Valdés on January 20, 2021
Two steps:
First go to Setup write VisualForce pages" and reach to VF page list. Here you will find the page you need to access.
Go to Setup
Domain
in quick find.Site label
. It will lead to all details for site.Public Access Settings
that will open profile access page.App
sectionObject Settings
(we are assuming we have an object access problem, which is most often the case.)Profile Overview
Object Settings
Selected object name (let's say Accounts)Edit
and give read
and write
access save
.Now try your app again. I hope then Authorization problem gets resolved.
Answered by Ankur Rana on January 20, 2021
You can not have access to Account from a public site when you use standard controller, only if the guest user has created the account which is not the case for you. That's Salesforce standard security. You will have probably to create a custom controller set as 'public without sharing' or 'global'.
Answered by Cloud Ninja on January 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP