Installation and setup

Installation and setup

This guide covers what to configure after the 3B Portals managed package is installed in an org.

1. Install the package

Install the "3B Portals & Mobile Apps" managed package (namespace b3p). The package includes the Apex layer, custom objects, custom metadata types, Visualforce host pages, static resources, and the two record page tabs (Web Portal and Page).

2. Configure the Portal custom setting

Portal__c is a hierarchy custom setting that holds almost all runtime configuration. Set the org default values in Setup, Custom Settings, Portal. See Configuration reference for the full field list. The must set fields:

Field Purpose
Site_URL__c The public site base URL that serves the static resources and portal. Required.
Files_Endpoint__c The external large files service endpoint. Required. Defaults to the 3B hosted file service.
Portals_are_SPA__c Check to render portals as a single page app without full reloads between pages.
Portal_Magic_Link_Validity__c How many days a magic link and session key stays valid. Default 14.
One_Time_Magic_Links__c Check so each magic link from the 3B Get Magic Link action works once only.
Secure_Session_Keys__c Enable after the other installed packages support signed session keys. See Magic links and session keys for the rollout order and impact on existing sessions and links.
Expire_Session_Keys__c Enforces legacy token expiry while Secure Session Keys is off. Signed tokens always expire.
Session_Length_Minutes__c Optional cap on each portal session in minutes. Leave blank for no session length cap.
Authorization_Session_Length__c Guest authorization session length in seconds. Default 3600.
Disable_Legacy_Data_Loader__c Disables browser-driven record loading after pages have been verified with the server-side merge introduced in 10.3. Recommended for production.

AI builder settings (AI_Provider__c, AI_Model__c, AI_API_Key__c) and Google_Fonts_API_Key__c are optional but needed for those features.

Optional passkey login (11.2.0)

Passkeys are off by default. To enable them, set Passkey Origin and Enable Passkeys on the effective Portal custom settings record for the Site guest user, then add an @passkeys link to a signed-in page. Refresh the portal so the updated service worker is active. Follow Passkey login for the exact origin format, enrolment and rollout checks. No direct guest access to the passkey objects is needed.

Verification emails and code lockout (12.0.0)

Packaged verification emails are off by default. To use them, configure a verified organization-wide sender, the HTTPS Site URL and an optional branded template on the effective Portal settings for the Site guest user. Replace any existing code-email automation when enabling the packaged sender to avoid duplicate messages. Follow Verification emails and code lockout.

Code lockout applies even when the packaged sender is off. Review Maximum incorrect code attempts and add the new attempt, status and counter fields to support staff's Contact layouts. Restore a locked-out user by resetting Incorrect code attempts to 0 and clearing Disabled Portal User together.

3. Authorization configuration

From 12.5, no authorization named credential is needed. Authorization Named Credential is retained as a deprecated field. The separate guest authorization token remains in use for hosted services; it is not a portal user session key.

4. Remote sites

The package ships two remote site settings that must be active for callouts:

5. Push notification credentials

Push delivery uses Firebase Cloud Messaging with a Google service account. Configure the Google_Service_Auth__mdt custom metadata record named Push:

Field Value
Project__c The Firebase project id
Client_Email__c The service account client email
Private_Key__c The service account RSA private key
Endpoint__c https://fcm.googleapis.com/v1/projects/<project>/messages:send
Token_URI__c https://oauth2.googleapis.com/token
Scopes__c https://www.googleapis.com/auth/firebase.messaging

The client side Firebase web config (apiKey, senderId, appId and so on) is injected into window.globals.pushConfig by Portal.page. See Push notifications.

Security note. Configure your own Firebase project, service account and Google Fonts API key before go live, and enable Secure Session Keys once your installed packages support it. See the Security hardening checklist.

6. Sites and permission sets

See Permission sets and access model for the complete access model.

6a. Enable the Site Visualforce Pages (mandatory, install and upgrade)

A Salesforce Site only serves Visualforce pages that appear under Setup, Sites, (your site), Site Visualforce Pages. That list is the guest profile's page access, and Sites do not honour Visualforce page access granted through a permission set, so including a page in the Portals Guest permission set is not sufficient.

Enable both pages on every Site that serves a portal:

  1. Setup, Sites, open the site.
  2. Click Edit next to Site Visualforce Pages.
  3. Move Portal and PortalServiceWorker into the Enabled Visualforce Pages list.
  4. Save.

PortalServiceWorker serves the portal's service worker at the site root. It is required for offline support and, from this release, for push notifications as well, because push moved onto the same worker. If it is missing, worker registration fails silently: no offline support, and no push for guest and community users.

The 11.1 package includes the updated Portal static resource.

See Offline support and caching and Push notifications.

7. Create your first portal and page

  1. Open the Web Portals tab and create a Web_Portal__c record. Set the PWA fields (short name, theme colour, start URL). See Web portals and pages.
  2. Open the Web Portal record's Builder tab and create the first page. It becomes the home page automatically. Use the page manager for additional pages, or keep using the Builder button on Page records. See Page manager and version history.
  3. On the Web Portal, set Home Page and Page 404 lookups to designate the landing and not found pages.
  4. Publish by saving in the builder. See Publishing pages.

Browser compatibility

Portal pages require a current browser with native page decompression support. From 12.0.0, a browser without DecompressionStream shows "Your browser is out of date and may be insecure. Please update your device or browser and try again." Update the browser or device operating system, then reopen the portal. The message replaces a raw technical error; it does not add support for older browsers.