PranavNagrecha/AwesomeSalesforceSkills / skills/admin/experience-cloud-member-management
experience-cloud-member-management
VerifiedUse this skill when adding external users to an Experience Cloud site, configuring self-registration, managing external user licenses, or customising the login and registration pages. Trigger keywords: add members to community, external user license, self-registration, customer portal login, partner user onboarding, ConfigurableSelfRegHandler. NOT for choosing which external user license to buy — use architect/experience-cloud-licensing-model. Also covers the networkMemberGroups membership block, NetworkMemberGroup assignment status, external-user creation from contacts, offboarding, and LoginHistory diagnosis for site logins. NOT for what records external users can see — use security/experience-cloud-security.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 22.7 KB |
| references/examples.md | markdown | 8.2 KB |
| references/gotchas.md | markdown | 19.4 KB |
| references/llm-anti-patterns.md | markdown | 9.6 KB |
| references/metadata-examples.md | markdown | 26.6 KB |
| references/well-architected.md | markdown | 8.6 KB |
| scripts/check_experience_cloud_member_management.pyexecutable | script | 21.4 KB |
| templates/experience-cloud-member-management-template.md | markdown | 2.7 KB |
references/well-architected.md
View on GitHub# Well-Architected Notes — Experience Cloud Member Management
## Relevant Pillars
- **Security** — External user access is a direct security boundary. Every license type, profile, and sharing rule decision determines what data external users can see and modify. Overly permissive profiles, misconfigured guest user access, or incorrect license choices can expose CRM data to unauthorised parties. Apply least-privilege principles: choose the lowest-capability license that meets the business requirement and keep external profiles as restrictive as possible.
- **Operational Excellence** — License seat management, user provisioning workflows, and periodic audits of deactivated users are operational processes, not one-time configuration. Without runbooks and monitoring, orgs silently exhaust license pools or accumulate dormant users who consume seats. Automate onboarding flows where possible and schedule regular user audits.
- **Reliability** — Self-registration flows depend on correctly configured default accounts, active sites, and valid handler classes. A misconfigured catch-all account or a syntax error in a custom `Auth.ConfigurableSelfRegHandler` brings down the entire self-registration path with opaque error messages. Validate end-to-end in a sandbox before activating in production.
## Architectural Tradeoffs
**Self-registration (declarative) vs custom Apex handler:** The declarative Configurable Self-Registration page (no code) is simpler to deploy and maintain but offers limited post-registration customisation. A custom `Auth.ConfigurableSelfRegHandler` Apex class adds flexibility (dynamic account assignment, domain allow/deny, enrichment calls) at the cost of additional code maintenance, testing, and Apex governor limit exposure. Prefer the declarative option unless a specific business requirement cannot be met without code.
**Profile-based membership vs manual user addition:** Profile-based membership scales automatically — any user with the correct profile gets site access immediately. This is efficient for large user populations but means access control shifts entirely to profile assignment. Manual user addition provides per-user vetting at the cost of administrative overhead. Choose based on the trust level of the user population and the required vetting rigour.
**Shared catch-all account vs per-partner accounts for self-registered users:** A single catch-all account is simpler and always required for self-reg defaults, but it collapses the sharing boundary — all self-registered users on that account can potentially see each other's records depending on sharing rules. For B2B scenarios where self-registered users should be isolated from one another, consider a post-registration automation (Flow or Apex trigger) that moves the new Contact/User to their own Account after registration.
## Anti-Patterns
1. **Using an internal profile for a contact-based external user** — Assigning a Salesforce-license profile to someone who is a customer or partner. The site membership itself is not the obstacle: `NetworkMemberGroup` states that members "can be either users in your internal org or external users assigned portal profiles", and `Network.allowInternalUserLogin` exists so employees can sign in on the site login page. The cost is the licence and the sharing shape — the profile fixes the user licence, and `User.AccountId` is read-only and null for Salesforce users, so the record is never account-linked. Use an external profile plus a `ContactId` for anyone reached through a Contact; use an internal profile deliberately, and only for employees.
2. **Skipping the default account for self-registration** — Enabling self-registration without setting a Default New User Account leads to silent failures that are hard to debug. This is the most common first-time setup mistake and should be the first thing checked when self-registration does not work.
3. **Ignoring licence capacity until it hits zero** — Treating licence management as set-and-forget. Deactivation does return a seat on the seat-metered SKUs (`UserLicense.UsedLicenses` counts licences "assigned to active users"), but it returns nothing on the Login-metered SKUs, where `MonthlyLoginsEntitlement` / `MonthlyLoginsUsed` are the real meter. Exhausting either is a hard stop, not a warning: "If you attempt to exceed the maximum number of licenses by inserting User records, the create request is rejected." Read both meters on a schedule and branch on which one is non-null.
## Official Sources Used
- Experience Cloud Help — Add Members to Your Experience Cloud Site: https://help.salesforce.com/s/articleView?id=sf.networks_customize_members.htm
- Experience Cloud Help — Configure Self-Registration: https://help.salesforce.com/s/articleView?id=sf.networks_self_reg.htm
- Apex Reference Guide — ConfigurableSelfRegHandler Interface: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_Auth_ConfigurableSelfRegHandler.htm — the interface's only method is `global Id createUser(Id accountId, Id profileId, Map<SObjectField, String> registrationAttributes, String password)`; the doc's own sample handler returns `Site.createExternalUser(u, accountId, password)`
- Apex Reference Guide — RegistrationHandler Interface: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_auth_plugin.htm — `User createUser(Id portalId, Auth.UserData userData)` and `void updateUser(Id userId, Id portalId, Auth.UserData userData)`, used for Auth. Provider single sign-on, not site self-registration
- Experience Cloud Help — Experience Cloud Licenses: https://help.salesforce.com/s/articleView?id=sf.users_license_types_communities.htm
- Metadata API Developer Guide — `Network` type (Summer '26 / v62 PDF, api_meta.txt L90671–91213): https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/api_meta.pdf — grounds `networkMemberGroups` (`<profile>` / `<permissionSet>` children, sample definition at L91837–91844), `selfRegistration` / `selfRegProfile`, `allowInternalUserLogin`, `enableMemberVisibility`, `enableGuestMemberVisibility`, `enableNicknameDisplay`, `disableReputationRecordConversations`, the `status` enum, and the note that `emailSenderAddress` cannot be updated via Metadata API
- Metadata API Developer Guide — `PermissionSet` type (api_meta.txt L94703–95240): the external-member permission set XML in references/metadata-examples.md, the optional `license` field replacing the deprecated `userLicense`, and the API 40.0+ rule that an unspecified permission is disabled on deploy
- Object Reference — `NetworkMemberGroup` and `NetworkMember` (object_reference.txt L188296–188695): https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/object_reference.pdf — supported calls (no `delete()` on either, no `create()` on `NetworkMember`), the `AssignmentStatus` state machine, the async add/remove behaviour, and the Chatter-customer exclusion (gotcha 7)
- Object Reference — `User`, `UserLicense` and `Profile` (object_reference.txt L294945–299740, L232482): `ContactId` requiring the Contact to have an `AccountId`, read-only `User.AccountId`, non-createable `UserType` and its enum, globally unique `Username`, `UsedLicenses` counting only active users, `MonthlyLoginsEntitlement` / `MonthlyLoginsUsed`, and "You can't delete a user in the user interface or the API" (gotchas 3, 8)
- Object Reference — `LoginHistory` (object_reference.txt L176628–177054): the `LoginType` enum including `EmployeeLoginToCommunity` and the Chatter Communities values, the `NetworkId` site filter, and the exhaustive filterable-field list that excludes `Status` (gotcha 9)
- Apex Reference Guide — `Site` class (apexrefguide.txt L230881–231300): https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf/salesforce_apex_developer_guide.pdf — the three `createExternalUser` overloads, legacy `createPortalUser`, `createPersonAccountPortalUser`, the contact-matching rule, the required nickname, `Site.ExternalUserCreateException`, and the API 30.0+ no-auto-commit behaviour
- Salesforce Developer Limits and Allocations Quick Reference (salesforce_app_limits_cheatsheet.txt L513–L585): per-licence 24-hour API call allocations for Customer Community, Customer Community Plus, Partner Community, their Login variants, and the three External Identity tiers (gotcha 10)
- Data Loader Guide (salesforce_data_loader.txt L349–L360): the 200-record SOAP import batch size used by the external-user CSV load in references/metadata-examples.md
- Salesforce Well-Architected Overview — architecture quality framing: https://architect.salesforce.com/docs/architect/well-architected/guide/overview.html
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |