Skip to content

Fortified IDDocs

Custom frontend

Reference for replacing the built-in user interface of one or more authenticators with your own frontend

Authenticators that present a user interface serve it as plain static files, separate from the authentication logic. This means the built-in frontend of a single authenticator can be replaced with your own, without changing code or rebuilding Fortified ID Access.

Replacing the whole frontend is the most far-reaching of three supported options. Pick the least invasive one that solves the problem.

ApproachWhat you controlWhen to use it
Branding overlayLogos, colors, titles, translations. The built-in application is still used.The default flow is right, but it must match your visual identity. See User interface.
Custom frontendThe complete user interface of one authenticator, including markup, layout, and interaction.You need a different user experience, your own frontend framework, or integration with an existing design system. Described on this page.
ExternalFlowAn entire step, hosted as a separate service on another host or domain.The user interface is owned by another system, or must run outside Fortified ID Access. See ExternalFlow.

An authenticator with a user interface is bound to a single context path that serves two roles. The HTTP method decides which one applies.

MethodConditionHandled as
GETAny requestView request. The view is served as a static file from the configured web root.
PUTHeader Content-Type: application/jsonAPI request. The message is routed to the authenticator using the type property in the request body. See Web Authenticator API.

A view request is completed in three steps:

  1. If the request path does not end with /, the browser is redirected to the same path with a trailing slash. This is what makes relative paths inside the view resolve correctly.
  2. The request is rerouted to view_path in the authenticator web root. The default is index.html.
  3. Static resources below the path are served from the overlay directories first, then from the web root. A resource that exists in both is served from the overlay.

Each authenticator type supplies a default web root, which is why webroot_dir can be left out of a standard configuration. Setting it explicitly replaces the built-in frontend for that authenticator instance only. Two instances of the same type can use two different frontends.

NameDescriptionDefaultMandatory
webroot_dirPath to the directory serving as authenticator web root. Point it at your own build output to replace the built-in frontend.Supplied by the authenticator type. See Authenticators with a replaceable view.false
view_pathEntry point served for a view request, relative to the web root.index.htmlfalse
overlay_dirDirectory searched before the web root. Applies to a custom frontend as well, so keep it empty unless you intend to override your own files.${system.customer_home}/overlayfalse
enable_precompressionServe precompressed .br or .gz variants from the web root when the browser accepts them.falsefalse
enable_precompression_overlayServe precompressed variants from the overlay directories.falsefalse

The frontend is free in every other respect, but it has to meet the following requirements to work inside an authentication flow.

RequirementWhy
Build with relative asset paths.The application is served from the authenticator context path, not from the web server root. Absolute paths such as /assets/main.js will not resolve.
Send API requests to the directory URL of the current page.The view and the API share one URL. Deriving the base URL from the page location keeps the frontend independent of where the authenticator is mounted.
Use PUT with Content-Type: application/json.Any other method is treated as a view request and returns the page instead of a JSON response.
Send cookies with every API request.The authentication state is held in the session identified by the session cookie.
Follow data.location when present.Responses of type complete and cancel return the location the browser must be sent to in order to continue the flow.
Display data.message when present.The message carries information intended for the user. When both a message and a location are supplied, show the message first and redirect once it is confirmed.
Implement the message protocol of the authenticator.Message types and payloads differ per authenticator type. The protocol is documented on the page for each authenticator.
Provide your own translations and configuration.The translation keys and overlay files used by the built-in applications are part of those applications. A custom frontend owns its own localization.

Every authenticator supports the common cancel request and the common complete, cancel, and failure responses. A minimal custom frontend therefore needs to handle at least those, plus the authenticator-specific request types, usually state and start.

The table lists the authenticator types that serve a view, together with the web root used when webroot_dir is not configured. Paths are relative to the installation directory.

Authenticator typeDefault web root
Selector, Selectweb/authenticator/selector
Impersonate, ImpersonateWithSearchweb/authenticator/impersonate_selector
UserNameAndPasswordweb/authenticator/username_password
UserLookupweb/authenticator/user_lookup
OTPValidator, OTP, OTPAuthenticatorweb/authenticator/otp_validation
Passkeyweb/authenticator/webauthn
Eidweb/authenticator/eid
BidOnMobileDeviceweb/authenticator/bankid/omd
BidOnOtherDeviceweb/authenticator/bankid/osd
FrejaWithQRCodeweb/authenticator/freja/freja_qr_or_appswitch
FrejaWithUserInputweb/authenticator/freja/freja_with_user_input
SithsWithQr, SithsWithQrAndAppSwitchweb/authenticator/siths_qr_or_appswitch
NiasOnSameDeviceweb/authenticator/nias/niasomd
NiasOnOtherDeviceweb/authenticator/nias/niasood
DeviceUserCode, OIDCDeviceUserCodeweb/authenticator/device_user_code

Authenticators that do not appear in the table have no view to replace. This includes header-based and Integrated Windows authenticators, which never involve the browser in a dialogue, the protocol managers for SAML and OIDC, and ExternalFlow, which delegates the entire step to another service.

Place a custom frontend outside the built-in web directory. The directory web/authenticator is part of the product installation and its contents are replaced when Fortified ID Access is upgraded.

  1. Build the frontend with relative asset paths and an index.html entry point.
  2. Copy the build output to a directory of your own, for example <installation path>/customer/frontend/<name>.
  3. Set webroot_dir in the authenticator configuration to that directory.
  4. Restart the service and request the authenticator context path in a browser.

If the page loads but the flow stalls, the cause is usually one of the following:

SymptomLikely cause
Assets return 404.The build uses absolute asset paths, or the entry point is not named index.html and view_path is not set.
API requests return the HTML page instead of JSON.The request is not a PUT, or the Content-Type header is missing.
Every API request starts a new authentication.Cookies are not sent, typically because the request is issued cross-origin.
Old files are still served after a deploy.An overlay directory still contains resources that take precedence over the web root, or a cached response is being reused.