Skip to content

Service provider keys

A service provider key is an RSA key pair with an X.509 certificate. Magento uses the active keys for two purposes:

  • Sign the authentication requests. The IdP uses the certificate to examine the signature.
  • Decrypt the assertions. The IdP encrypts the assertion for the certificate.

You need a key only when a provider signs its requests or receives encrypted assertions. The SP metadata of a provider lists the certificates of the active keys that have not expired, for the uses that the provider settings enable.

To open the list of keys, go to System > Permissions > Visus Single Sign-On > Service Provider Keys.

The SSO Service Provider Keys grid with one active key and one inactive key. The grid shows the key ID, the certificate fingerprint, the expiry date and the active status.

  1. Click Generate Key.

  2. Confirm the message. The new key is active immediately.

  3. When the admin asks, verify your identity.

  4. Give the certificate of the new key to each identity provider that needs it.

The generated key has these properties:

Property Value
Key type RSA, 3072 bits
Certificate Self-signed, SHA-256
Validity 1095 days (3 years)
Certificate subject The host name of the admin

SAML uses the certificate only to carry the public key. Thus the certificate does not need a certificate authority.

  1. Click Add Existing Key.

  2. In Certificate (PEM), paste the X.509 certificate.

  3. In Private Key (PEM), paste the private key.

  4. Set Active.

  5. In Your Password, enter your current admin password.

  6. Click Save.

The module refuses the key in these conditions:

  • The certificate is not a valid X.509 certificate in PEM format.
  • The private key is not a valid private key in PEM format, or it has a passphrase.
  • The private key does not belong to the certificate.
  • The private key is not an RSA key of at least 2048 bits.
  • The certificate has expired.

Some IdPs take the certificate as a .cer file. Open the key, and click Download Certificate. You can also copy the PEM text from the Certificate (PEM) field.

Key Signs requests Decrypts assertions
Active, certificate valid Yes Yes
Active, certificate expired No Yes
Inactive No No

When more than one active key can sign, the oldest key signs. A new key signs only when the old key expires or becomes inactive. Thus the IdPs can receive the new certificate before the new key signs.

An expired key still decrypts. During a rotation, an IdP can still encrypt for the old certificate.

If no key is active, the grid shows a warning: “No service provider key is active.”

Rotate the key before its certificate expires.

  1. Generate a new key, or add an existing key.

  2. Give the new certificate to each identity provider. You can also give each IdP the new service provider metadata of its provider.

  3. Keep the old key active until each IdP uses the new certificate. The old key continues to sign until you deactivate it.

  4. Deactivate the old key. The new key then signs the requests.

  5. Optional: delete the old key.

The module warns the admins before the certificate expires. Only the active key whose certificate expires last counts. During a rotation, the new key replaces the old key. Thus the module does not warn about the old key.

The warnings start at the number of days of Service Provider Certificate Expiry Warning (Days). The default is 30 days. More notices follow at 7 days, at 1 day and at the expiry.

Each notice has these parts:

  • A system message at the top of the admin, while the certificate expires soon or has expired.
  • An admin notification.
  • An email to the Service Provider Certificate Expiry Email Recipients, if you set recipients.

The visus_admin_sso_notify_sp_key_expiry cron job sends each notice one time. A new key resets the notices. For the settings, refer to System configuration.

The admin system message that tells that the service provider certificate expires in 7 days, with a link to manage the service provider keys.

Database triggers record each change to the keys. The log keeps a SHA-256 digest of the private key, not the key. Refer to Logs and auditing.