Skip to content

Commit 9730bd6

Browse files
lfranckeclaude
andauthored
Explain the openldap-tls SecretClass in the LDAP tutorial (#861)
* Explain the openldap-tls SecretClass in the LDAP tutorial The AuthenticationClass references an openldap-tls SecretClass for TLS server verification that the tutorial-openldap stack creates silently. Explain what it is and link to the TLS server verification concepts page so readers know how to create one for a real LDAP server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Clarify the openldap-tls SecretClass uses autoTls vs k8sSearch for real servers The tutorial-openldap stack creates openldap-tls as an autoTls/autoGenerate SecretClass: the Secret Operator owns the CA and uses it both to issue OpenLDAP's server cert and to verify it. Contrast this with a real LDAP server, where you only have the server's CA cert and use the k8sSearch backend instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add trailing newline to ldap-authenticationclass.yaml Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e77c74c commit 9730bd6

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

modules/tutorials/examples/ldap-auth/ldap-authenticationclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ spec:
1515
verification:
1616
server:
1717
caCert:
18-
secretClass: openldap-tls
18+
secretClass: openldap-tls # <4>

modules/tutorials/pages/authentication_with_openldap.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,21 @@ include::example$ldap-auth/ldap-authenticationclass.yaml[]
120120
<1> The name of the AuthenticationClass, which needs to be referenced later
121121
<2> The hostname in this case is the Service at which the OpenLDAP is running, inside of Kubernetes.
122122
<3> Here the SecretClass name is referenced
123+
<4> A SecretClass used to verify the LDAP server's TLS certificate, see below.
123124

124125
// [source,bash]
125126
// include::example$ldap-auth/30-install-openldap.sh[tag=apply-ldap-authenticationclass]
126127

128+
The AuthenticationClass connects to LDAP over TLS (port `1636`) and verifies the server's certificate against the CA provided by the `openldap-tls` SecretClass.
129+
You did not have to create that SecretClass: the `tutorial-openldap` stack created it for you.
130+
It uses the `autoTls` backend with `autoGenerate: true`, so the Secret Operator generates its own certificate authority and uses it both to issue OpenLDAP's server certificate and to let the products verify that certificate.
131+
This works because the Secret Operator owns the CA, including its private key, from end to end.
132+
133+
Connecting to a *real* LDAP server is different: you do not control the server's certificate and usually only have its CA certificate, not the CA's private key.
134+
In that case you create the SecretClass yourself using the `k8sSearch` backend, which simply makes the existing CA certificate available to the products.
135+
A SecretClass used only for server verification needs nothing but the CA certificate; it does not need a key.
136+
See xref:concepts:tls-server-verification.adoc[] for a complete, copy-pasteable example.
137+
127138
Remember the name of the AuthenticationClass (`openldap`), you will use it in the next steps when configuring the products.
128139

129140
[#superset]

0 commit comments

Comments
 (0)