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
Mahesh GorrepatiMahesh Gorrepati 

Guest User cannot access @AuraEnabled Apex Controller. kindly help here

SwethaSwetha (Salesforce Developers) 
HI Mahesh,
I think this is an intended behavior. The "Restrict Access to @AuraEnabled Apex Methods for Guest and Portal Users Based on User Profile" update is enforced in Winter ’21.

See https://help.salesforce.com/s/articleView?id=release-notes.rn_lc_restrict_apex_guest_users.htm&release=228&type=5 for more details

To update profiles and permissions to access Apex with @AuraEnabled, 
> In setup, you can add Apex classes to a profile under “Enabled Apex Classes Access”.
> For a permission set, you’ll see it under Apps as “Apex Class Access”.

If you want to proactively find Apex classes that leverage @AuraEnabled, check out the open source tool @AuraEnabled Scanner.

Reference


If this information helps, please mark the answer as best. Thank you
Arun Kumar 1141Arun Kumar 1141
Hi Mahesh,

The Guest User does not have access to @AuraEnabled Apex Controllers by default. To address this issue, you can follow these steps:
1. Go to Setup in Salesforce.
2. Search for "Sites" and select the "Sites" option.
3. Select the Site that the Guest User is accessing.
4. Click on "Public Access Settings" or "Guest User Profile" (the name may vary based on your Salesforce version).
5. In the profile settings, ensure that the Guest User has access to the necessary Apex classes and related objects.
6. Save the changes and test the functionality again.

By granting the necessary access permissions to the Guest User profile, you should be able to resolve the issue and allow the Guest User to access the @AuraEnabled Apex Controller.

Please mark it as a best answer if this helps you,
Thanks!
Mahesh GorrepatiMahesh Gorrepati
i did  process,still guest user is unable to access the apex class