Portal sign-in and spaces (internals)
Section titled “Portal sign-in and spaces (internals)”This page is for integrators and developers who link users into the portal,
build their own client against the same identity service, or need to explain
exactly why a user lands where they do. It covers the portal’s OIDC flow, the
/signin deep link, the error codes behind the messages users see, and how a
space is resolved and enforced.
The end-user view of the same features is Signing In & Choosing a Space. The identity service itself (providers, OTP, rate limits, audit stores) is covered for operators in Identity server, and the OIDC endpoints and grants in Authentication & OAuth.
Spaces and domains
Section titled “Spaces and domains”A space is the tenant data boundary: it scopes the entities, collections,
views and users that a request can reach. A space record carries its display
data (space_information: name, description, icon), its address (url,
domain_identifier, and the derived full_url), an active/inactive state and
an end-user maintenance state.
The root space is served on the bare base domain (its domain_identifier is
root). Every other space is served on a subdomain of the same base domain: with
base address example.com and identifier sales, the space is reached at
sales.example.com. The browser’s host therefore decides the space; switching
spaces means navigating to another host.
Two ideas are both derived from the host and should not be confused:
- Space: the data boundary, which data a request sees.
- Domain: the sign-in and branding boundary, which sign-in methods, MFA policy and external providers apply. This is what shapes the sign-in page.
Administration of spaces and domains is in Spaces & domains.
The portal’s sign-in flow
Section titled “The portal’s sign-in flow”The portal never collects a password. It redirects the browser to the identity service’s hosted pages and receives the user back, using the OIDC authorization-code flow. Relative to the authority URL the portal uses:
| Purpose | Endpoint |
|---|---|
| Authorization (login) | {AUTHORITY}/auth |
| Token | {AUTHORITY}/token |
| User info | {AUTHORITY}/me |
| End session (logout) | {AUTHORITY}/session/end |
| Keys (JWKS) | {AUTHORITY}/jwks |
| After-login return page | {APP_URL}/auth-callback |
The sequence:
- Start-up check. The app checks for a valid session, including a silent iframe check against the identity service. If one exists, the user goes straight in.
- Redirect to sign-in. If the user is not signed in and the deployment is
configured to redirect automatically, or the user selects Sign In, the
browser goes to the identity service. The UI language is passed as the
langparameter. - Authenticate with a method the domain allows (see Sign-in methods).
- Second factor, if the MFA context requires one (see Second factor).
- Return to
{APP_URL}/auth-callback, where the app finalizes the session and forwards the user to the destination.
If the sign-in service cannot be reached when the user selects Sign In, the
portal shows an error message instead of a button that does nothing
Since 1.10.
First sign-in
Section titled “First sign-in”On a user’s first sign-in the portal routes to the onboarding page at
/welcome instead of the destination. Its start button marks the first login as
complete and, when the tenant has a tour configured and enabled, starts the
product tour. The page stays reachable from the profile menu’s Help item.
The /signin deep link Since 1.6
Section titled “The /signin deep link Since 1.6”https://<portal>/signin?returnUrl=<path> hands the user to sign-in and brings
them back to <path> afterwards. The page itself renders only a loading
indicator.
- Only safe, same-site paths are honored. External or malformed
returnUrlvalues are ignored, so the sign-in flow cannot be used as an open redirect. - Already signed in: the user goes straight to the target (or the home page),
and Back does not bounce through
/signinagain. - Not signed in: the user is taken to the login page. Back from there lands on the portal home page rather than the loader, and sign-in is not restarted, so no loop is possible.
&provider=<name>Since 1.10. Starts sign-in directly with one of the domain’s external providers. The portal forwards it as the authorization parameteridp_hint. The value is the provider’s uniquename, not its display label. A blank or unknown name is ignored and the normal login page is shown. Behaviour on the identity side:idp_hint.
The deep link was added to the 1.6 line and is part of 1.8 and later.
Login-page behaviours the portal relies on
Section titled “Login-page behaviours the portal relies on”- Single-provider skip
Since 1.10: a domain whose only way in is one external provider skips the login page. On by default; an operator can turn it off. See Single-provider skip. - Cancel
Since 1.4: the login page’s Cancel link (and its 10-minute idle timer) returnsaccess_deniedto the client; the portal treats that as “go home”, landing on its home page rather than the no-access page (1.6 and later). See Cancelling the login page.
When the portal cannot start: reason codes Since 1.10
Section titled “When the portal cannot start: reason codes Since 1.10”Before Angular starts, the portal fetches its sign-in settings for the host (see
Browser bootstrap without a client secret).
On failure it replaces the splash with a static bilingual page. The page shows
the English message, the Arabic message, a details block (Reason, Status,
Request, Correlation ID, Time) and a Retry button that reloads. The
reason is also in the page’s data-reason attribute.
| Reason code | English message on the page |
|---|---|
TENANT_NOT_RESOLVED | This address is not linked to an organisation. |
BOOTSTRAP_ENDPOINT_MISSING | The sign-in service is not available on this server. |
TENANT_NOT_READY | This organisation is still being set up. Please try again shortly. |
SERVER_ERROR | The sign-in service returned an error. |
NETWORK | The sign-in service could not be reached. |
TIMEOUT | The sign-in service took too long to respond. |
BAD_CONFIG | The sign-in configuration is not supported by this version of the app. |
DEPLOYMENT_CONFIG | The application configuration could not be loaded. |
Tenant under maintenance Since 1.10
Section titled “Tenant under maintenance Since 1.10”While a tenant is being restored from a backup or moved to another cell, sign-in
is refused with 503 TENANT_IN_MAINTENANCE and a Retry-After header. The
message reads “This tenant is being restored from a backup. Try again
shortly.” (or “…is being moved…”). During start-up the same condition
surfaces as TENANT_NOT_READY. Details:
Errors and retries.
Sign-in methods
Section titled “Sign-in methods”What the hosted login page offers depends on the domain:
| Method | Shown when | Notes |
|---|---|---|
| Username + password | the domain’s supportLocalSignIn is enabled | Standard local sign-in. |
| External provider (SSO) | one or more providers are linked to the domain | One button per allowed external OAuth2/OIDC provider. |
| Passkey (passwordless) | the domain’s supportPasskey is enabled | WebAuthn, discoverable-credential flow: any passkey registered for the site can respond. |
After a successful password sign-in, a user with no passkey may be offered the Register Passkey page (with Skip).
A failed local sign-in re-renders the login page with the matching message:
| Code | Message |
|---|---|
INVALID_USERNAME_OR_PASSWORD | Invalid username or password. |
ACCOUNT_LOCKED | Account is locked |
ACCOUNT_DEACTIVATED | The account is deactivated, Please contact with your system administrator |
Sensitive (non-GET) identity requests are rate-limited per client address
(10 per 15 minutes by default). See
Rate limit on identity requests.
Every attempt, successful or not and by which method, is recorded for security
auditing (Since 1.4), including failed passwords, locked or deactivated
accounts, passkey failures and MFA outcomes. Users see their own history in
Logins › Attempts. See
Authentication audit trails.
Account linking and profile sync
Section titled “Account linking and profile sync”- A provider identity already linked to a user signs straight in.
- An existing account with the same email but no link may be offered manual
linking
Since 1.8: the user proves ownership of the existing account by password. See Manual account linking. - With no matching account and the provider configured for it (
supportSignup), a user is created automatically. See Auto-provisioning. syncProfileOnSignInSince 1.8refreshes the profile from the provider at each sign-in. A sync failure never blocks the sign-in.
Password pages
Section titled “Password pages”The identity service hosts the self-service password pages:
- Forgot password at
/identity/reset-password: requests a reset link by email, then sets a new password from the emailed link. The page always shows the same success message, whether or not the email matched an account. - Change password at
/identity/change-password: for signed-in local users. External (SSO) accounts are redirected away, since their password is managed by the provider.
Reset-link lifetime and replacement are in Password reset.
Second factor
Section titled “Second factor”After the first factor (password or external provider), the identity service resolves the user’s MFA context from:
- whether the user has TOTP (authenticator app) enrolled
Since 1.8; - whether the domain requires SMS or email one-time codes (
sms2FA/email2FA), and whether WhatsApp is offeredSince 1.10; - whether the user has passkeys that can act as a second factor.
If a factor is required, the browser goes to /interaction/{uid}/mfa. There the
user enters a code (or uses a passkey or a recovery code), can switch method and
can request a resend. Error codes: MFA_INVALID_CODE, MFA_CODE_EXPIRED, and
MFA_ATTEMPTS_EXCEEDED (which prompts a fresh code). If no factor applies, MFA
is skipped.
- The method last chosen is stored on the account, not in the browser, so a
reload keeps it and another user on the same computer gets their own
Since 1.8. - The resend limit is a fixed rolling window, not a counter for the whole sign-in
attempt, so a code that timed out never leaves the user unable to request a
fresh one
Since 1.8. See OTP rate limiting.
Human verification (Since 1.8) can guard sign-in, MFA and password reset. When
its service is unavailable, those flows refuse; there is no bypass. See
Human verification.
Resolving the active space
Section titled “Resolving the active space”The user’s spaces
Section titled “The user’s spaces”The portal loads available spaces from GET /api/v1/spaces/my. Only spaces
that are active, not deactivated and of which the user is a member are
returned.
The active space
Section titled “The active space”The portal picks the active space by matching the browser host against
`${domainIdentifier}.${url}` for each space. If nothing matches, it falls
back to the root space.
The switcher
Section titled “The switcher”The sidebar’s space list renders only when the user has more than one space.
Each entry shows the space’s icon and name. Selecting one navigates to that
space’s full_url: a full page navigation to another host, not an in-page
toggle, so the session check can run again on the new host. The list is hidden
while the user acts under a delegation and for Restricted users.
When memberships change, the gateway’s cache of hosts and memberships is refreshed automatically. A space the user was just added to that does not appear yet is usually a stale cache.
How the gateway ties a request to a space
Section titled “How the gateway ties a request to a space”space-resolvermatches the request host against the cached list of space hosts and setsx-space-id(and thex-space-maintenanceflag). Any such header the client sent is discarded first, so the host alone decides. An unknown host is rejected withSPACE_ERROR(“Space ID not found”; HTTP404since 1.10,400before).domain-resolverresolves the tenant domain for the host.user-space-checkerconfirms the signed-in user is a member of the resolved space. If not, it answers HTTP 403 with codeSPACE_FORBIDDENand a list ofavailable_spaces.
The portal catches SPACE_FORBIDDEN and routes to its no-access page
(You don’t have access to this space!), passing available_spaces so the
user can jump to a space they may open. If the user turns out to be
unauthenticated at that point, they go back through sign-in instead.
Plugin details: Space and domain resolution · Tenancy and identity.
Unavailable spaces
Section titled “Unavailable spaces”- Deactivated: the space is fully switched off. It is excluded from
spaces/myand from host resolution, so it cannot be opened. - End-user maintenance: the space still resolves, but the gateway marks the
request (
x-space-maintenance) so end users see a maintenance state.
The root space cannot be deactivated. Both states are set by administrators.
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27