Login and registration (token based workflow)

Login and registration (token based workflow)

3B Portals uses a passwordless, token based login. A portal user is a Contact. There is no password. Users can sign in with a magic link (see Magic links and session keys), a one time email access code, or an optionally configured passkey. Each method results in a portal session key. In 12.5, enable Secure Session Keys after migrating dependent packages to use signed tokens that always expire and support server-side revocation. Legacy tokens remain in use while the setting is off.

The access code login flow

  1. Send code. The user enters their email. The frontend calls b3p.Portal action sendAccessCode. The action generates a fresh 6 character code, stores it on the Contact Temporary_Password__c, logs an Access Code Request Web Event, and makes the code available to your configured email sender. Enable the packaged sender or retain your existing automation; see Verification emails and code lockout.
  2. Verify code. The user enters the code. The frontend calls validateAccessCode. On a match the action mints a session key, clears Temporary_Password__c (the code is single use), logs a Success Validating Access Code event, and returns the session key. On mismatch it increments the incorrect-attempt counter, logs Invalid Access Code Entered, and returns an error. The code remains unchanged until the lockout limit is reached. Successful verification resets the counter.

Disabled users (Disabled_Portal_User__c) are blocked from portal access. From 12.0.0, repeated incorrect codes disable the Contact once the configured limit is reached, including when the code is used for passkey enrolment. Requesting another code does not reset the counter. See Verification emails and code lockout for the configurable limit, support fields and recovery steps.

Passkey login and enrolment

From version 11.2.0, administrators can enable passkeys for an exact HTTPS portal origin. Supported browsers show Sign in with a passkey. Users select a saved account and complete their device verification without entering an email address. Email-code login remains available.

With passkeys enabled, successful email verification offers Add a passkey before entering the portal. Users can register one or select Continue without adding; cancelling enrolment preserves the verified email login. A magic link or an existing session cannot authorise enrolment. See Passkey login for setup, limits and recovery.

Registration

If registration is allowed, the user provides first name, last name, and email. The frontend calls registerUser. The action checks for an existing or disabled Contact, otherwise creates a Contact with a temporary access code and logs a Registration Web Event. The user then verifies the emailed code exactly like the login flow.

Disable self-registration

From 12.0.0, select Disable Self Registration (b3p__Disable_Self_Registration__c) on a Web Portal to allow only existing Contacts to sign in. The setting is off by default.

The login screen hides Not registered?, ignores ?frontDoor=register, and the server rejects registration for that portal with: "Self registration is not available on this portal. Please contact us for access."

Custom integrations calling registerUser should pass the current pageId alongside the user's name and email. The Page's Web Portal determines the setting. If the page ID is missing, invalid or has no Web Portal, registration is blocked when any Web Portal in the org disables self-registration.

The login component

The login UI is the x-login-component web component. It is not a draggable builder block. The runtime injects it programmatically when a page needs authentication.

How login propagates through the portal

The login component and the portal shell communicate over the shared EventBus and DOM events:

Inside page HTML you can trigger auth actions with special anchor hrefs handled by the runtime:

href Action
@login Open the login component
@logout Log the user out
@passkeys Manage the signed-in Contact's active passkeys for this origin
@setupPush Request push permission and register the device
@testPush Send a local test notification

Page navigation links use #PageName. See Web portals and pages.

Session lifecycle summary