TrustBuilder .IO

How to renew a signing certificate

This document describes how to replace a key certificate used by TrustBuilder.io before it expires, for example the idhub-signing certificate.

The idhub-signing certificate is used to:

  • sign the SAML responses and assertions sent to SAML Service Providers,

  • sign the ID tokens issued to OAuth / OpenID Connect Service Providers, including the system clients TrustBuilder Administration Portal and TrustBuilder Self Service Portal,

  • sign the authentication requests sent to SAML Identity Providers.

A dedicated section covers Microsoft Entra ID (Office 365) federated domains, where the new certificate must also be declared with PowerShell. The last section explains how to renew the idhub-encryption certificate.

If the signing certificate expires, users can no longer sign in to the federated applications, and administrators can no longer sign in to TrustBuilder Admin portal. Renew it several weeks before its expiry date.

When the signing certificate is replaced in TrustBuilder.io, every application that validates the signature with the old certificate rejects the authentication until it trusts the new certificate. Plan the change during a maintenance window and keep an administration session open in a browser during the whole procedure.

Prerequisites

You should have:

  • Access to TrustBuilder Admin portal with administrator rights.

  • For each Service Provider, a contact or an admin access able to update the trusted certificate on the application side.

  • For Microsoft Entra ID federated domains:

    • A Windows workstation with PowerShell 5.1 or PowerShell 7.

    • An Entra ID account allowed to manage domain federation (for example, Global Administrator).

Overview

  1. Identify where the certificate is used

  2. Generate a new key certificate

  3. Export the public certificate

  4. Declare the new certificate on the application side

  5. Switch to the new certificate in TrustBuilder.io

  6. Finalize the change on the application side

  7. Test

  8. Remove the old certificate

Step 1: Identify where the certificate is used

  1. In TrustBuilder Admin portal, go to Settings > Certificates.

  2. In the Key Store tab, note the Alias and the Valid Until date of the certificate to renew.

  3. Click the View icon of the certificate and check the Default Signing, Default Encryption and Default TLS fields. If one of them is selected, the certificate is also referenced in the Defaults tab.

  4. Go to Access Management > Service Providers. Browse all the pages of the list, or type a name in the Search by name field.

  5. For each SAML2 and OAUTH Client Service Provider, click Edit and check the Manage Certificates section. Note every Service Provider where the Certificate column shows the alias of the certificate to renew.

  6. Go to Integrations > Identity Providers and repeat the check for each SAML Identity Provider. A SIGNING (KEY) context is used when the Authentication Request Signed option is enabled.

The system Service Providers TrustBuilder Administration Portal and TrustBuilder Self Service Portal (type OAUTH Client) use the idhub-signing certificate. They are usually displayed at the bottom of the last page of the Service Providers list. To find them quickly, type TrustBuilder in the Search by name field. If they are not switched to the new certificate, administrators and users can no longer sign in to the portals when the old certificate expires.

The Proxy Locations Service Providers, such as Administration Portal (/idhub/admin) and Self Service Portal (/idhub/selfservice), do not use a signing certificate. Their Manage Certificates section stays empty: do not modify them.

Step 2: Generate a new key certificate

  1. Go to Settings > Certificates > Key Store.

  2. Click Generate Key Certificate.

  3. Fill in the fields:

    • Alias: enter a name that identifies the new certificate, for example idhub-signing-2028. Illegal characters are automatically removed from the alias.

    • Algorithm: select the algorithm and key length, for example RSA with key strength 2048 or RSA with key strength 4096. EC P-256 and EC P-384 are also available. Check that all the Service Providers support the selected algorithm.

    • Validity: enter the validity period in months, for example 24.

    • Subject: in Common name, enter a value, for example the alias. The other Relative Distinguished Names are optional. Click the bin icon to remove the unused lines, or Add DN to add other ones.

  4. In Key Usages, select the three following options:

    • Digital Signature

    • Data Encipherment

    • Key Cert Sign

These three key usages are mandatory. Key usages cannot be modified after generation: if one is missing, generate a new certificate.

  1. Click Accept.
    The generation may take a few seconds. The message Certificate generated successfully, any present illegal characters have been stripped from the alias is displayed.

The new certificate appears in the Key Store list. Check the Valid From and Valid Until dates.

You can also click Generate Key Certificate directly from the Manage Certificates section of a Service Provider. The certificate is then created in the same Key Store.

Step 3: Export the public certificate

  1. In Settings > Certificates > Key Store, click the View icon of the new certificate.

  2. Click Copy To Clipboard.

  3. Paste the content into a text editor and save the file with the .cer extension, for example idhub-signing-2028.cer.
    The file starts with -----BEGIN CERTIFICATE----- and ends with -----END CERTIFICATE----- (PEM format).

  4. Click Close.

This file only contains the public certificate. It can be shared with the application administrators.

Step 4: Declare the new certificate on the application side

This step is not performed in TrustBuilder Admin portal. It is performed in the administration console or the configuration of each application (Service Provider) that receives the messages signed by TrustBuilder.io. If you do not manage the application, send the file exported in Step 3 to its administrator.

Each application stores the TrustBuilder.io certificate to check the signature of the SAML responses or ID tokens. Check how each application identified in Step 1 stores this certificate, and act as follows:

The application...

Where

Action

imports the TrustBuilder.io SAML metadata from a URL and refreshes it automatically

-

No action. The new certificate is retrieved after Step 5.

uses a SAML metadata file imported manually

SAML / SSO settings of the application

After Step 5, click Get SAML2 Metadata on the Service Provider in TrustBuilder.io and import the new metadata into the application.

stores the IdP certificate and accepts several certificates

SAML / SSO settings of the application, IdP certificate field

Now, add the file exported in Step 3 next to the current certificate. The switch in Step 5 is transparent for users.

stores the IdP certificate and accepts only one certificate

SAML / SSO settings of the application, IdP certificate field

Replace the certificate with the file exported in Step 3 at the same time as Step 5. Users cannot sign in between the two changes.

is an OpenID Connect client that retrieves the keys from the JWKS endpoint

-

No action. The new key is published on https://<your-tenant>.trustbuilder.io/idhub/oidc/v1/jwks.json after Step 5.

is an OpenID Connect client that stores the public key

OIDC settings of the application

After Step 5, update the key with the one published on the JWKS endpoint.

The system Service Providers TrustBuilder Administration Portal and TrustBuilder Self Service Portal are internal to TrustBuilder.io: no action is required on the application side for them.

Microsoft Entra ID (Office 365) federated domain

Microsoft Entra ID stores the TrustBuilder.io signing certificate in the federation configuration of each federated domain. It does not retrieve the new certificate automatically, so you must update it with Microsoft Graph PowerShell.

Entra ID accepts tokens signed with the certificate declared in SigningCertificate or in NextSigningCertificate. Declaring the new certificate as NextSigningCertificate first avoids any interruption of service.

  1. Open a PowerShell console and install the Microsoft Graph module for domain management:

    Install-Module Microsoft.Graph.Identity.DirectoryManagement -Scope CurrentUser -Force
    Import-Module Microsoft.Graph.Identity.DirectoryManagement
    
  2. Connect to Microsoft Graph with an account allowed to manage domain federation:

    Connect-MgGraph -Scopes "Domain.ReadWrite.All"
    
  3. List the domains and identify the federated ones:

    Get-MgDomain | Select-Object Id, AuthenticationType
    
  4. Retrieve the federation configuration of the domain and its identifier:

    $domainName = "contoso.com"
    $federation = Get-MgDomainFederationConfiguration -DomainId $domainName
    $federationId = $federation.Id
    $federation | Format-List DisplayName, IssuerUri, PassiveSignInUri, SigningCertificate, NextSigningCertificate
    

    The IssuerUri and PassiveSignInUri values point to your TrustBuilder.io tenant.

  5. Load the certificate exported in Step 3 and convert it to the Base64 format expected by Microsoft Graph:

    $certFilePath = "C:\certificates\idhub-signing-2028.cer"
    $pem = Get-Content -Path $certFilePath -Raw
    $certBase64 = $pem -replace "-----BEGIN CERTIFICATE-----", "" -replace "-----END CERTIFICATE-----", "" -replace "\s", ""
    
  6. Check that the value is a valid certificate and that it is the expected one:

    $cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new([System.Convert]::FromBase64String($certBase64))
    $cert | Format-List Subject, NotBefore, NotAfter, Thumbprint
    

    The subject and the dates must match the certificate generated in Step 2.

  7. Declare the new certificate as the next signing certificate:

    Update-MgDomainFederationConfiguration -DomainId $domainName -InternalDomainFederationId $federationId -NextSigningCertificate $certBase64
    
  8. Check the result:

    Get-MgDomainFederationConfiguration -DomainId $domainName | Format-List SigningCertificate, NextSigningCertificate
    

    NextSigningCertificate must contain the new certificate. SigningCertificate still contains the current one.

Repeat steps 4 to 8 for each federated domain linked to the TrustBuilder.io tenant.

Step 5: Switch to the new certificate in TrustBuilder.io

Switch every item identified in Step 1. Expand each section below.

Service Providers

For each SAML2 and OAUTH Client Service Provider identified in Step 1:

  1. Go to Access Management > Service Providers.

  2. Click Edit on the Service Provider.

  3. In the Manage Certificates section, on the line with the context SIGNING (KEY), select the new certificate in the Certificate list.

  4. Check that the From and To dates are updated with the validity of the new certificate.

  5. Click Save & Close.

Replace the certificate on the existing SIGNING (KEY) line. Do not add a second line: the validity periods of two certificates may not overlap for the SIGNING (KEY) context.

If a SAML Service Provider imports TrustBuilder.io SAML metadata manually, click Get SAML2 Metadata in the Service Provider edition page and send the new metadata to the application administrator.

TrustBuilder Administration Portal and TrustBuilder Self Service Portal

Apply the same procedure as for the Service Providers to the two system OAuth clients:

  • TrustBuilder Administration Portal (OAUTH Client)

  • TrustBuilder Self Service Portal (OAUTH Client)

Switch TrustBuilder Administration Portal last, and keep an administration session open in another browser window. After saving, wait about one minute before testing the sign-in: a 403 Forbidden error may be displayed while the configuration is applied.

Identity Providers

For each SAML Identity Provider identified in Step 1:

  1. Go to Integrations > Identity Providers.

  2. Click Edit on the Identity Provider.

  3. In the Manage Certificates section, on the line with the context SIGNING (KEY), select the new certificate in the Certificate list.

  4. Click Save & Close.

If the Identity Provider validates the authentication requests signed by TrustBuilder.io, click Get SAML2 Metadata and update the TrustBuilder.io metadata on the Identity Provider side. For example, for TrustBuilder MFA, paste the new metadata into the SAML connector of the MFA Admin console.

Defaults

The Defaults tab of Settings > Certificates defines the certificates used by default for a context, for the items that do not declare a certificate themselves.

  1. Go to Settings > Certificates > Defaults.

  2. If the list is empty (Here will be a list of the existing Certificates Uses), no default certificate is defined: go to the next step.

  3. If a line references the old certificate, select the new certificate in the Certificate list and click Save.

Step 6: Finalize the change on the application side

For applications that accept only one certificate, replace the old certificate with the new one now.

For OAuth / OpenID Connect applications that store the public key, update it with the new key published on the JWKS endpoint. The key identifier (kid) is the alias of the new certificate.

Microsoft Entra ID (Office 365) federated domain

Once the authentication test is successful (see Step 7), set the new certificate as the main signing certificate:

Update-MgDomainFederationConfiguration -DomainId $domainName -InternalDomainFederationId $federationId -SigningCertificate $certBase64

Check the result:

Get-MgDomainFederationConfiguration -DomainId $domainName | Format-List SigningCertificate, NextSigningCertificate, SigningCertificateUpdateStatus

SigningCertificate must contain the new certificate.

Repeat for each federated domain linked to the TrustBuilder.io tenant.

Step 7: Test

  1. Log out, or open a new incognito window in your browser.

  2. Access each Service Provider updated in Step 5 and authenticate through TrustBuilder.io.

  3. Sign in to the Admin portal (https://<your-tenant>.trustbuilder.io/idhub/admin) and to the Self Service Portal (https://<your-tenant>.trustbuilder.io/idhub/selfservice).

  4. For Microsoft Entra ID, sign in to a Microsoft 365 service (for example https://portal.office.com) with a user of the federated domain. You are redirected to your TrustBuilder.io tenant, then back to Microsoft 365.

  5. Check that the OAuth / OpenID Connect clients, including the Admin portal and the Self Service Portal, use the new certificate:

    • Open https://<your-tenant>.trustbuilder.io/idhub/oidc/v1/jwks.json. The kid value of the published key is the alias of the new certificate, for example "kid": "idhub-signing-2028".

    • Optionally, sign in to the Self Service Portal with the browser developer tools open (Network tab). Select the request to the token endpoint and copy the id_token value from the response. Decode its first part (header) with a Base64 decoder: the kid value is the alias of the new certificate.

The sign-in itself looks the same for end users: no message indicates the certificate change.

Troubleshooting and rollback

If an authentication fails, go to Insights > Event Logs Table to check the error. If TrustBuilder.io logs a successful authentication but the application rejects the response, the application still trusts the old certificate (see Step 4 and Step 6).

To roll back, select the old certificate again in the Manage Certificates section, as long as it has not expired.

Step 8: Remove the old certificate

Keep the old certificate in the Key Store until all the applications have been tested and until it expires, so that you can roll back if needed.

When the old certificate is no longer referenced by any Service Provider, Identity Provider or default setting:

  1. Go to Settings > Certificates > Key Store.

  2. Click the Delete icon of the old certificate.

Deleting a certificate that is still referenced by a Service Provider or an Identity Provider breaks the authentication.

Renewing the encryption certificate

The idhub-encryption certificate is used to decrypt the messages encrypted for TrustBuilder.io, for example SAML assertions encrypted by an Identity Provider. It is referenced with the context ENCRYPTION (KEY).

First, check whether it is used: in Step 1, look for the ENCRYPTION (KEY) context in the Service Providers and Identity Providers, and for the Default Encryption field of the certificate. If the context is not used anywhere, the expiry of idhub-encryption has no impact on authentication and no action is required.

If it is used, follow the same procedure with the following differences:

Step

Signing certificate

Encryption certificate

Step 2: Alias

for example idhub-signing-2028

for example idhub-encryption-2028

Step 2: Key Usages

Digital Signature, Data Encipherment, Key Cert Sign

Key Encipherment, Data Encipherment

Step 4: Who must receive the new certificate

The applications that verify the signature (Service Providers)

The applications that encrypt the messages sent to TrustBuilder.io (usually Identity Providers)

Step 5: Context to update

SIGNING (KEY)

ENCRYPTION (KEY)

The application that encrypts the messages must receive the new certificate before the switch in Step 5. Otherwise, TrustBuilder.io cannot decrypt the messages.