Overview
When configuring Single Sign-On using the Tyk Dashboard embedded Tyk Identity Broker, stored certificates may fail to load during startup or authentication, resulting in authentication failures or runtime errors.
Symptom & Log Output
The Tyk Dashboard logs show the following recurring error entries:
Error while parsing certificate: cert_id x509: decryption password incorrect prefix=cert_storage
profile certificate was not loaded prefix="SAML AUTH"
cannot process request, middleware not loaded prefix="SAML AUTH"Root Cause
When an SSL or SAML certificate containing a private key is uploaded via the Tyk Dashboard UI or API, the Gateway encrypts the private key at rest using its private certificate encoding secret before persisting it to Redis. When the Dashboard embedded TIB component loads the profile to sign AuthnRequests or validate assertions, it attempts to decrypt the key using its own configured secret.
If the secrets do not match identically, or if an environment variable name contains a typographical error, decryption fails with the x509 decryption password incorrect error.
Resolution Steps
- Verify Environment Variable Names: Ensure that both the Tyk Gateway and Tyk Dashboard containers have the exact variable name defined without missing characters or trailing typos:
- Align Encoding Secrets: If not explicitly set via the dedicated variable, confirm the fallback secrets match. The Gateway falls back to its main API secret, while the Dashboard falls back to its Tyk API secret configuration.
- Re-upload Stored Certificates: If the certificate was originally uploaded when a different secret was configured, delete the certificate in the Dashboard and re-upload the combined PEM bundle so that it is encrypted with the current active secret.
- Restart Services: Restart the Tyk Dashboard pod to clear the certificate cache and verify the logs indicate clean initialization.
TYK_GW_SECURITY_PRIVATECERTIFICATEENCODINGSECRET=<shared-secret>
TYK_DB_SECURITY_PRIVATECERTIFICATEENCODINGSECRET=<shared-secret>
Applies To
Tyk Dashboard 5.0+, Tyk Identity Broker (TIB), and SAML SSO Provider configurations.
Comments
0 comments
Please sign in to leave a comment.