Configuration steps on OpenID Connect Provider
The following describes the configuration that is needed on the OpenID Connect Provider.
Firstly you need to create a client to use with InterFormNG2.
Secondly, InterFormNG2 uses role-based security, so a number of roles need to be defined. The OpenID Connect standard does not detail how roles should be handled, so this can vary between providers. The following roles must be created:
Role name | Description |
ROLE_SYSTEM_ADMIN | System administrator access |
ROLE_TENANT_ADMIN | Tenant administration access |
ROLE_USER | Regular user access |
ROLE_READ_ONLY | Read-only access |
ROLE_WEB_SERVICE | Minimal access for web service clients. |
The following is a description on how to create the needed client and roles in the Keycloak user interface:
- Select an existing realm or create a new one.
- Go to Clients → Create client. Select client type “OpenID Connect”. Give it an appropriate client id such as “interformng2”. The client id must be valid in a URL without encoding, so only use alphanumeric characters.
- Press Next to get to Capability Config. Switch on “Client authentication”. As a minimum enable “Standard flow”. You may also want to enable “Service accounts role” (see the next section on webservice input).

4. Press Next to get to “Login Settings”. Under “Valid Redirect URIs”, add the URL of your InterFormNG2 installation with “/OpenId” added at the end. For instance,
https://example.com:8086/openId. Under
“Web origins” put a plus character “+”.
Now save the client.
5. Go to the “Roles” tab of the client. Create Role → ROLE_SYSTEM_ADMIN. Repeat this process for all the roles in the above table.
In an InterFormNG2 multi-tenant configuration, it is also necessary to create a role for each tenant, to grant access to that tenant. For each tenant, create a role with the name TENANT_<tenantid> where you replace <tenantid> with the ID of the tenant in InterFormNG2, so for instance for the default home tenant, create role TENANT_home.
The created roles can be assigned to users. Note the important limitation that in a multi-tenant configuration, each user can only have access to ONE tenant. I.e. only assign one of the TENANT_ roles to each tenant. If you do not assign a TENANT_ role, the user will as default have access to the home tenant.
Also note that it is possible for a user to have both ROLE_SYSTEM_ADMIN as well as roles on a tenant. When logging in as a user with both ROLE_SYSTEM_ADMIN and a tenant role, you will be asked after login to choose between system admin access and tenant access.
Assigning roles to users
The defined roles can be assigned to the users that should have access to InterFormNG2. Note that in addition to these roles, it is mandatory to also assign the default role “offline_access” to all users, so InterFormNG2 can create a refresh token to maintain the user's access while the user is active.
In Keycloak, user roles are assigned under Users on the “Role mapping” tab.
With the addition of user groups configuration in InterFormNG2, a number of new authorizations (roles) have been added. These can also created and assigned with OpenID, in the same way as the regular roles. The list of roles is quite long so note that it is only necessary to create the ones that are going to be used. The following roles can be created:
Display name | Value |
Approver - Templates | ResourceApprove-template |
Approver - Translations | ResourceApprove-translation |
Approver - Images | ResourceApprove-image |
Approver - Fonts | ResourceApprove-font |
Approver - Sample documents | ResourceApprove-document |
Approver - Workflows | ResourceApprove-workflow |
Approver - Velocity e-mail templates | ResourceApprove-mailTemplate |
Approver - Template components | ResourceApprove-templateComponent |
Approver - Template styles | ResourceApprove-style |
Approver - Validation rules | ResourceApprove-validationRule |
Approver - Transformations | ResourceApprove-transform |
Approver - Other resources | ResourceApprove-other |
Editor - Templates | ResourceUpdate-template |
Editor - Translations | ResourceUpdate-translation |
Editor - Images | ResourceUpdate-image |
Editor - Fonts | ResourceUpdate-font |
Editor - Sample documents | ResourceUpdate-document |
Editor - Workflows | ResourceUpdate-workflow |
Editor - Velocity e-mail templates | ResourceUpdate-mailTemplate |
Editor - Template components | ResourceUpdate-templateComponent |
Editor - Template styles | ResourceUpdate-style |
Editor - Validation rules | ResourceUpdate-validationRule |
Editor - Transformations | ResourceUpdate-transform |
Editor - Other resources | ResourceUpdate-other |
Due to the number of different roles, it can be a good idea to make use of groups where several different roles can be assigned to a single group. All the users that are a member of that group, will then have all of those roles.
When using workflows with webservice input, it is recommended to use the client credentials authentication flow, as this is simpler for machine-machine communication. The remote output client can only operate with the client credentials flow. To use client credentials flow, firstly make sure that the authentication provider allows this. In Keycloak this is done by enabling the “Service account roles” authentication flow on the client.

Secondly, make sure that the authentication provider includes the client id in the Audience (aud) claim in the access token. In Keycloak this can be configured as follows:
- Under client scopes, create a new scope for this purpose. Call it for instance “client-self-audience”. Make sure the switch “Include In Token Scope” is off.
- On the new scope, select the “Mappers” tab, then Add Mapper → By Configuration → Audience. Give it a name and under “Included Client Audience” select your client id. Make sure “Add to access token” is enabled.
3. Finally navigate back to the client and under the “Client scopes” tab, add the new client-self-audience scope to the client scopes as “Default” type.
Once the OpenID Connect provider has been configured, then the InterFormNG2 configuration can be updated in the application-default.properties file. The following properties must be set:
Property | Value |
authentication.provider | OpenIdConnect |
authentication.provider.resourceId | The ID of the client that was created on the provider. |
authentication.provider.discoveryUrl | |
authentication.provider.redirectUri | The redirect URI that was specified in the provider configuration. |
authentication.provider.secret | The secret defined on the provider. With Keycloak this is found on the “Credentials” tab of the client. Alternatively this setting can be set in the settings user interface for Authentication Provider instead. The advantage to setting this in the UI is that the value will be stored with encryption. When it is set in the UI, it is not needed in these properties. |
Example values:
authentication.provider=OpenIdConnect
authentication.provider.resourceId=interformng2
authentication.provider.secret=4uz7MzcvBXwhqf8BJwOIFib4eYtPu1CX
Multi-tenant configuration for web service clients
Using remote output client with OpenID authentication
When InterFormNG2 is configured for OpenID authentication, then web-service clients will also need to authenticate with the OpenID provider when invoking workflows that have the OAuth2 web-service input component.
We recommend using the client credentials flow for authentication. As described above, this means that the access token does not contain a tenant access role, so for multi-tenant environments, requests to InterFormNG2 workflows need to include the APIKey HTTP header.
Errors related to APIKey checks are printed to the system log, so if you experience authentication problems with webservice clients, then look in the system log for error messages that start with “Webservice Input:".