Skip to content

Org context (B2B)

Mosaic Journeys support business-to-business (B2B) use cases by tailoring the journey experience based on a user's membership in an organization. When Mosaic runs a journey, it can adapt the flow dynamically according to the org context—that is, the organization currently in use—and leverage that organization’s data.

The org context concept links a user identity to their membership in a specific organization and plays a critical role in determining whether and how the user is permitted to authenticate. For example, organization A may require passkey authentication, while organization B might allow a simple email magic link. A member of organization A would need to register a passkey to complete login. For a user to successfully authenticate, they must belong to the specified organization.

For flows driven by hosted OIDC or similar auth requests (not only journeys), you can often pass org_id on the request; if it is omitted, Mosaic may still resolve the organization from the member’s email domain. Journey-based flows set the org context with the steps described below.

When authentication completes under an organization context, Mosaic also returns org_id automatically in the ID token and in the UserInfo response, so your customer-facing application can identify which organization was used for the login (see Get user claims from access token).

For more information about B2B capabilities, see the B2B overview.

Use cases

  • B2B member invite journeys: Guided onboarding for organization members. Depending on the org context, Mosaic can provide a unique invitation flow using the SSO service. See tutorial for hands-on instructions.
  • B2B member login journeys: Customizing login experience depending on organization. See tutorial for hands-on instructions.

B2B journeys

B2B journeys (Admin Portal > B2B Identity > Journeys) widely rely on the org context. Typically, an org context is defined early in the journey—for example, through the overall journey configuration or prior orchestration steps. However, Mosaic provides a way to explicitly set or override an org context at any point in the journey when an authentication step occurs. This is particularly useful in complex flows where multiple authentication steps might occur under different organizational scopes, or where the org context needs to change dynamically based on previous decisions.

Steps that set the org context

  • SSO invite journeys automatically obtain the org context from the invitation email.
  • Authenticate Member resolves the organization from the value given in Organization (Email or Domain) and sets it on the journey context as part of authentication. It also presents organization selection where the member belongs to more than one. Available in SSO journeys, on Transmit hosted experiences.

Steps that use the org context

  • Login form and the authentication steps carry an Organization Context setting under Configuration. Leave it on Default, or select Manual and give the organization in Set Organization ID to override the context for that step alone. On the authentication steps, Default takes the context from the client group in the associated SSO service.

  • Once the context is set, the journey operates in the scope of a specific organization and not the entire tenant, including access to members, authentication methods, organization settings, etc. The organization's data is available to any later step through @organizations.current() expressions.

Type @organizations.current(). in an expression field and the editor suggests the fields it carries:

FieldDescription
organization_idID of the organization.
nameName of the organization.
alias_nameAlias name of the organization.
domainsDomains of the organization.
app_idsA list of Mosaic applications the organization can access.
enabledIndicates if the organization is currently enabled.

Expression editor suggesting the fields available on @organizations.current()