fix: add CommonName to SAML SP certificate (#10700)

# Which Problems Are Solved

There is no CN (CommonName) defined in the certificates to use an
external SAML IDP.

# How the Problems Are Solved

Add Issuer and CommonName to the certificate information.

# Additional Changes

None

# Additional Context

Closes #9048

Co-authored-by: Gayathri Vijayan <66356931+grvijayan@users.noreply.github.com>
(cherry picked from commit 4c078c1474)
This commit is contained in:
Stefan Benz
2025-10-07 16:58:55 +02:00
committed by Livio Spring
parent db643547b1
commit 43b4fc1019

View File

@@ -294,8 +294,13 @@ func samlCertificateAndKeyGenerator(keySize int, lifetime time.Duration) func(id
SerialNumber: big.NewInt(int64(serial)),
Subject: pkix.Name{
Organization: []string{"ZITADEL"},
CommonName: fmt.Sprintf("ZITADEL SP %s", id),
SerialNumber: id,
},
Issuer: pkix.Name{
Organization: []string{"ZITADEL"},
CommonName: "ZITADEL",
},
NotBefore: now,
NotAfter: now.Add(lifetime),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,