The Authentication worker uses Handlebars templates to generate the HTML used in site login forms, account management pages, PIN emails, and consent messages. These templates can be overridden by named provider, provider type, and by subsite.
Default Templates
There are three different kinds of template. By default they are found at
Top Level Login
The top level templates provide the page header and body content of the main login form. The templates of enabled providers are pulled into this template as part of the page render.
\loginform\body.hbs
\loginform\header.hbs
Actions
These actions include the templates used for account management, mismatched (update prompt) email messages, user consent, login with link (for iCM site users) and user linking. Actions can be overridden on a per-provider or subsite basis.
\actions\accountmanagement\options\body.hbs
\actions\accountmanagement\options\header.hbs
\actions\email.link.login\emaillink\body.hbs
\actions\email.link.login\emaillink\header.hbs
\actions\email.link.login\emaillinksent\body.hbs
\actions\email.link.login\emaillinksent\header.hbs
\actions\emailupdate\body.hbs
\actions\emailupdate\header.hbs
\actions\getuserconsent\body.hbs
\actions\getuserconsent\header.hbs
\actions\twofactorauthentication\confirmationemail\body.hbs
\actions\twofactorauthentication\confirmationemail\subject.hbs
\actions\userlinking\confirmationemail\body.hbs
\actions\userlinking\confirmationemail\subject.hbs
\actions\userlinking\confirmationemailsent\body.hbs
\actions\userlinking\confirmationemailsent\header.hbs
\actions\userlinking\newuserlinkingoptions\body.hbs
\actions\userlinking\newuserlinkingoptions\header.hbs
\actions\userlinking\notificationemail\body.hbs
\actions\userlinking\notificationemail\subject.hbs
Type Specific
The header and body content of specific authentication types (Facebook, Google etc).
\types\<typeName>\header.hbs
\types\<typeName>\body.hbs
Overrides
You can customise any of the default templates using overrides. Overrides can be applied globally, by provider type (eg all Google providers), by named provider (eg a specific instance of a Google provider), and by subsite.
Override Location
The location of your overrides needs to be somewhere accessible to the API Server, which in practice means creating them in the iCM custom folder using the File Manager. The path to the override root then needs to be set in the
While developing your override templates, set the worker's
- Open the File Manager
- Right-click on the top level "custom" folder and pick "Create a directory"
- Give the directory a meaningful name. In the example below it's called
auth-hbs-templates (ignore the directory calledhandlebarstemplates - it's used by the forms designer) - Update your Configuration file and add the location of the custom folder as the
hbTemplateOverrideRoot - In an iCM.NET environment this will be
"hbTemplateOverrideRoot": "E:/iCM10/tomcat/icmresource/mnt/custom/auth-hbs-templates/" - In an iCM4j environment this will be
"hbTemplateOverrideRoot": "/opt/icm/tomcat/icmresource/mnt/custom/auth-hbs-templates/"
- In an iCM.NET environment this will be
Example Override Root
Creating the following override root:

Would need the following adding to the worker configuration (in an iCM4j/Java environment):
{
"name": "auth",
"instances": 1,
"threadsPerInstance": 10,
"hbCacheTemplates": false,
"hbTemplateOverrideRoot": "/opt/icm/tomcat/icmresource/mnt/custom/auth-hbs-templates/",
"userProfileToObjectFieldMapping": {...},
"providers": [...]
}
Template Resolution
Now that you have an override root, you can create the override tree. The position of files in the tree determines how they are used.
This table outlines the priority order in which the worker will look for overrides. Within each section the top path takes priority, with the default \templates\ directory checked last.
- <overrideRoot> is the root set in the worker configuration
- <subsiteName> is the subsite the template will be used on (passed to the worker by the Authentication template as part of the call to
renderLoginForm ). This must match the subsite "Name" in your Subsite Properties. This name is case sensitive - <typeName> is the provider type you want to override (eg facebook, google, adfs). All named providers of this type will use the override unless a specific <providerName> override is found first. Enter this name in lowercase
- <providerName> a named provider in your worker configuration (eg you have configured two providers of the Facebook type with different names). Enter this name in lowercase
You'll need to resend the configuration to the API Server if you create new files and directories, even with caching disabled. Once the templates have been created, editing them with the cache disabled will display your changes straight away. Similarly, you'll need to resend the configuration if you delete a file or directory.
Re-enable the
| Path | Type | Description |
|---|---|---|
| Top Level | ||
| <overrideRoot>\named\ <subsiteName>\loginform\ | NamedOverride | I want to override the login form for a named subsite |
| <overrideRoot>\loginform\ | Global | I want to override the login form globally |
| templates\loginform\ | Type | The default, as supplied with the worker |
| Type Specific | ||
| <overrideRoot>\named\ <subsiteName>\<providerName>\types\<typeName> | NamedOverride + Provider | I want to override the template for a named provider of this type on a specific subsite |
| <overrideRoot>\named\ <subsiteName>\types\<typeName>\ | NamedOverride | I want to override the template for all providers of this type on this subsite |
| <overrideRoot>\ <providerName>\types\<typeName>\ | Provider | I want to override the template for a named provider of this type, whatever subsite it is used on |
| <overrideRoot>\types\<typeName>\ | Global | I want to override the template for all providers of this type |
| templates\types\<typeName>\ | Type | The default, as supplied with the worker |
| Actions | ||
| <overrideRoot>\named\ <subsiteName>\<typeName>\actions\ | NamedOverride + Provider | I want to override the action template for all providers of this type using this action on a certain subsite |
| <overrideRoot>\named\ <subsiteName>\actions\ | NamedOverride | I want to override the action template for all providers using this action on a certain subsite |
| <overrideRoot>\<typeName>\actions\ | Provider | I want to override the action template for all providers of this type type using this action |
| <overrideRoot>\actions\ | Global | I want to override the action template for all providers using this action |
| templates\actions\ | Type | The default, as supplied with the worker |
Example Override Tree
This example overrides the openid templates on the GOSSDocs subsite, and globally overrides (ie all named providers across all subsites) the adfs templates:

Creating an Override Template for a Subsite
To create an override for a subsite, do the following.
- Create the override root as described above
- In the "named" directory create a directory with the name of your subsite - GOSSDocs in the example above
- In the subsite directory create a directory called "types"
- In the types directory create a directory for the provider - openid in the example above. The name needs to match the system name described in the Provider Types documentation of each provider
- Right-click on your provider directory and choose "Create a file"
- In the editor, create your template with the appropriate name and .hbs extension
Default Templates
This zip file contains all of the default templates (in the types directory): Default Auth Handlebars Templates (ZIP, 62KB)
You could import the entire directory into the custom folder, but we recommend only copying in the files you need.
If you create overrides you will need to maintain them if we release updates.
Context
The data object passed to your template includes all of the worker and provider configuration, which you can access via the
Base Provider Parameters can be accessed by name, for example
