Skip to content

PranavNagrecha/AwesomeSalesforceSkills / skills/admin/experience-cloud-guest-access

experience-cloud-guest-access

Verified

Use when designing or configuring public pages on an Experience Cloud site — guest user profile setup, page-level access settings in Experience Builder, object/field visibility for unauthenticated visitors, and explicit sharing rules that expose data on public pages. Triggers: 'configure public pages Experience Cloud', 'guest user profile setup', 'unauthenticated site access', 'public community page visibility', 'make page visible without login'. NOT for authenticated user features (use admin/experience-cloud-member-management). NOT for security hardening or remediation of guest user exposure (use security/guest-user-security). Also covers the deployable shape: pageAccess on the route file, the guest Profile's objectPermissions and fieldPermissions, sharingGuestRules, siteGuestRecordDefaultOwner on CustomSite, and the Network guest flags.

references/well-architected.md

View on GitHub
# Well-Architected Notes — Experience Cloud Guest Access

## Relevant Pillars

- **Security** — Guest user configuration is a security-critical operation. Every decision about page access, profile permissions, OWD, and sharing rules has a direct security consequence. Least-privilege is the governing principle: expose only the objects, fields, and records that public pages genuinely need. Unnecessary permissions cannot be "cleaned up later" — they represent live exposure the moment the site goes public.
- **Operational Excellence** — The one-guest-profile-per-site model means that the guest profile is a shared configuration artifact with site-wide scope. Operational clarity requires treating profile changes as site-wide changes, not page-level changes. A documented change process and a pre-publish checklist (see templates/) reduce operational errors.
- **Reliability** — A public page that fails for unauthenticated visitors due to missing profile permissions or misconfigured OWD is a reliability failure. The three-gate model (page access + profile permissions + sharing/OWD) must all be validated before a public page launch. Testing in an incognito browser is a required reliability check, not optional.

## Architectural Tradeoffs

**Public Read Only OWD vs. Private OWD + Sharing Rules**

Setting external OWD to Public Read Only is simpler to configure and eliminates the need for Guest User Sharing Rules. However, it exposes all records of that object to all guest users across all public pages. This tradeoff is acceptable for objects like Product2 where records are inherently meant for public consumption. It is unacceptable for custom objects that may contain customer data, financial data, or internal metadata, even if the current records are benign — a future record insert could inadvertently become public.

The recommended default is Private OWD plus criteria-based Guest User Sharing Rules that selectively expose only intended records. This requires more configuration but is reversible and auditable.

**One Flexible Public Site vs. Separate Sites per Audience**

A single site can serve both public and authenticated pages by mixing page access settings. This reduces infrastructure overhead. However, it means the guest profile and authenticated member profiles coexist in the same site, and changes to one can affect the other. When the public and authenticated use cases diverge significantly (different branding, different objects, different compliance requirements), separate sites with independent guest profiles are architecturally cleaner.

**Explicit Route Classification vs. Inheriting From the Site**

Leaving routes at `pageAccess: UseParent` is less work now and is how Experience Builder leaves them by default. It also means the site's own guest setting is the only thing standing between an unclassified page and the public web, and that setting is a single checkbox someone will flip during a launch. Classifying every route explicitly costs one review pass and converts a site-wide switch into a set of per-page decisions that a diff can review. Choose inheritance only when the site genuinely has one audience.

**Create-Only Guest Writes vs. No Guest Writes At All**

A public form is a real requirement, and the platform supports exactly one shape for it: `allowCreate` on the guest profile plus `siteGuestRecordDefaultOwner` on the site, with no read-back. That shape is safe because the guest never sees the record it created and cannot enumerate other people's. The tradeoff is that the visitor gets no confirmation view and no "check my case status" page without authenticating — which is a product decision, not a security one. Teams that dislike the constraint reach for `allowRead` on the same object, and that turns a write-only funnel into a readable table governed only by whatever sharing rule exists. Take the constraint, or take the login.

## Anti-Patterns

1. **Setting External OWD to Public Read Only "to fix" an empty public page** — this is the most common shortcut in guest access configuration. It exposes every record of the object to every unauthenticated visitor on every site, far beyond the scope of the page being fixed. The correct fix is to create a Guest User Sharing Rule with the criteria that match the intended public records.

2. **Granting View All or Modify All on the guest user profile** — View All bypasses all record-level security including OWD and sharing rules, making every record of the object visible to any unauthenticated user globally. This is never appropriate for a public site. Modify All on a guest profile allows anonymous write operations across all records, which is a critical security risk.

3. **Not testing as a guest user before publishing** — configuration errors in guest access are invisible until the page is loaded in an unauthenticated context. Testing in an authenticated session (even as an admin) will show data that the guest profile cannot access. Incognito browser testing is the only reliable pre-publish validation method.

## Official Sources Used

- Securely Share Experience Cloud Sites with Guest Users — https://help.salesforce.com/s/articleView?id=sf.networks_guest_user_sharing.htm
- Secure Guest Users Sharing Settings — https://help.salesforce.com/s/articleView?id=sf.networks_secure_guest_users.htm
- Give Secure Access to Unauthenticated Users — https://help.salesforce.com/s/articleView?id=sf.networks_unauthenticated_access.htm
- Experience Cloud Developer Guide (Guest User Context) — https://developer.salesforce.com/docs/atlas.en-us.communities_dev.meta/communities_dev/communities_dev_guest_user.htm
- Metadata API Developer Guide — **CustomSite** (`siteGuestRecordDefaultOwner` API 51.0+ owns records guests create; `guestProfile` "Read only"; `requireHttps` removed in API 52.0+ and ignored earlier; `clickjackProtectionLevel` enumeration; `enableAuraRequests`; the type's own "for Digital Experiences … see Network" scope note) — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf (`api_meta.txt:46743–47240`) — supports gate 5 in `references/metadata-examples.md` and gotchas 10 and 11. (verified 2026-09-04)
- Metadata API Developer Guide — **SharingRules / SharingGuestRule / SharedTo** (`sharingGuestRules` API 47.0+, `criteriaItems` and `booleanFilter` 48.0+, "For SharingGuestRule, the `accessLevel` field can be set only to Read", `includeHVUOwnedRecords` default `false` and uneditable after creation, `sharedTo/guestUser` is a nickname list usable only with `SharingGuestRule`, all four rule types share one `.sharingRules` file) — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf (`api_meta.txt:129069–129072`, `:129240–129352`) — supports gate 4 and gotchas 12 and 13. (verified 2026-09-04)
- Metadata API Developer Guide — **Profile / ProfileObjectPermissions / ProfileFieldLevelSecurity** (`allowRead`/`allowCreate`/`allowEdit`/`allowDelete`, `viewAllRecords` and `modifyAllRecords` apply "regardless of the sharing settings for the object", `viewAllFields` API 63.0+; `readable`/`editable` and the portal default of `false`; "the returned `.profile` files only include security settings for the other metadata types referenced in the retrieve request"; the `*` wildcard on `CustomObject` "doesn't match standard objects") — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf (`api_meta.txt:97565–98510`) — supports gate 3, gotcha 9, and the checker's ERROR rules. (verified 2026-09-04)
- Metadata API Developer Guide — **ExperienceBundle / DigitalExperienceBundle / Network** (route `pageAccess` values `UseParent`/`Public`/`RequiresLogin` with "the status of the site determines the status of the route"; `authenticationType` for LWR vs `isAvailableToGuests` for Aura and `UNAUTHENTICATED` unsupported for post-Winter-'23 LWR sites; ExperienceBundle must be enabled in Setup for Aura sites; `enableGuestChatter`, `enableGuestFileAccess` "automatically enabled" when public access is on, `enableGuestMemberVisibility`; `Network.site` "Required. The CustomSite associated with the Experience Cloud site") — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf (`api_meta.txt:51103–51128`, `:52695–52812`, `:59875–60620`, `:90671–91060`) — supports gates 2 and 6 and gotchas 7 and 8. (verified 2026-09-04)
- Metadata API Developer Guide — **SharingSettings / SiteSettings / CommunitiesSettings / ContentSettings** (`enableSecureGuestAccess` "always true … regardless of the value that you set", retroactive to API 47.0; `enableSitesRecordReassignOrgPref` and `enableGuestRecordReassignOrgPref` both deprecated in API 63.0 and later; `enableSiteGuestUserToUploadFiles`; `enablePreventBadgeGuestAccess`) — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf (`api_meta.txt:112839–113180`, `:127101–127147`, `:127224–127229`) — supports gate 0 and gotcha 14. (verified 2026-09-04)
- Apex Developer Guide — **Apex managed sharing and the sharing keywords** (on `__Share.UserOrGroupId`: "You can't grant access to unauthenticated guest users using Apex"; `without sharing` "ensures that the sharing rules for the current user aren't enforced"; triggers "always run implicitly in a `without sharing` context") — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/salesforce_apex_developer_guide.pdf (`apexdev.txt:12564`, `:4803–4830`, `:4881–4884`) — supports gotcha 12 and the handoff to `security/guest-user-security`. (verified 2026-09-04)
- Object Reference for the Salesforce Platform — **User.UserType, AccountShare.RowCause, Knowledge__kav** (`Guest`: "user whose access is limited because they're an unauthenticated user without login credentials"; `GuestRule`: "the user or group has access via a … guest user sharing rule"; `IsVisibleInPkb`: "Required. Indicates whether the article is visible in the public knowledge base"; `PublishStatus` `Draft`/`Online`/`Archived`) — https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/object_reference.pdf (`object_reference.txt:17742`, `:160944–161060`, `:232430–232460`) — supports the verification queries in `references/metadata-examples.md` and the Knowledge rule in `references/examples.md`. (verified 2026-09-04)
- Object Permissions reference (`PermissionsViewAllFields`, API 63.0+) — https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_objectpermissions.htm — confirms View All Fields is object-scoped read on all fields including future ones; guest/external assignment restrictions documented in View All / Modify All overview. (verified 2026-08-14)
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall