Skip to content

Commit 1095952

Browse files
authored
Merge pull request quarkusio#55533 from sberyozkin/improve_oidc_client_auth_docs
Minor improvements to OIDC client authentication docs
2 parents 28b56de + 7a1dcbe commit 1095952

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ quarkus.oidc.credentials.jwt.key-id=mykeyAlias
221221
Using `client_secret_jwt` or `private_key_jwt` authentication methods ensures that a client secret is not sent to the OIDC provider, thereby avoiding the risk of interception by a 'man-in-the-middle' attack.
222222

223223
[[jwt-bearer-client-authentication]]
224+
==== JWT Bearer
225+
224226
.Example: Using a JWT Bearer token to authenticate a client
225227

226228
[source,properties]
@@ -235,11 +237,14 @@ For more information, see the link:https://www.rfc-editor.org/rfc/rfc7523#sectio
235237
<2> Path to a JWT bearer token.
236238
Quarkus loads a new token from the filesystem and reloads it when the token expires.
237239

238-
.Example: Using a SPIFFE JWT-SVID token to authenticate a client
240+
[[spiffe-jwt-client-authentication]]
241+
==== SPIFFE JWT-SVID
239242

240243
link:https://spiffe.io[SPIFFE] (Secure Production Identity Framework for Everyone) JWT-SVID tokens can be used as client assertions for client authentication.
241244
When the JWT source is set to `spiffe-jwt`, the `client_assertion_type` parameter is set to `urn:ietf:params:oauth:client-assertion-type:jwt-spiffe` and the token's `sub` claim must contain a valid SPIFFE ID starting with `spiffe://`.
242245

246+
.Example: Using a SPIFFE JWT-SVID token to authenticate a client
247+
243248
[source,properties]
244249
----
245250
quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus/
@@ -249,10 +254,12 @@ quarkus.oidc.credentials.jwt.token-path=/var/run/secrets/tokens <2>
249254
----
250255
<1> Use a SPIFFE JWT-SVID token to authenticate the OIDC provider client.
251256
<2> Path to a SPIFFE JWT-SVID token.
257+
252258
Quarkus loads a new token from the filesystem and reloads it when the token expires.
253259
The token's `sub` claim is verified to start with the `spiffe://` scheme.
254260

255-
When no `token-path` is set but the xref:security-spiffe-client.adoc[SPIFFE Client extension] is present, Quarkus retrieves JWT-SVID tokens directly from the local SPIRE Agent instead of reading them from the file system.
261+
When no `quarkus.oidc.credentials.jwt.token-path` is set but the xref:security-spiffe-client.adoc[SPIFFE Client extension] is present, Quarkus retrieves JWT-SVID tokens directly from the local SPIRE Agent instead of reading them from the file system.
262+
256263
Tokens are cached and refreshed automatically before they expire.
257264

258265
[source,properties]
@@ -297,6 +304,8 @@ quarkus.oidc.credentials.jwt.subject=custom-subject
297304
quarkus.oidc.credentials.jwt.issuer=custom-issuer
298305
----
299306

307+
You can also use `quarkus.oidc.credentials.jwt.audience` to customize a SPIFFE JWT-SVID audience when `quarkus.oidc.credentials.jwt.source=spiffe-jwt` but no `quarkus.oidc.credentials.jwt.token-path` is set and the xref:security-spiffe-client.adoc[SPIFFE Client extension] is present. See the <<spiffe-jwt-client-authentication>> for more information.
308+
300309
==== Apple POST JWT
301310

302311
The Apple OIDC provider uses a `client_secret_post` method, in which the secret is a JWT produced with a `private_key_jwt` authentication method, but with the Apple account-specific issuer and subject claims.
@@ -317,7 +326,7 @@ quarkus.oidc.credentials.jwt.subject=${apple.subject}
317326
quarkus.oidc.credentials.jwt.issuer=${apple.issuer}
318327
----
319328

320-
==== mutual TLS (mTLS)
329+
==== Mutual TLS (mTLS)
321330

322331
Some OIDC providers might require that a client be authenticated as part of the mutual TLS authentication process.
323332

docs/src/main/asciidoc/security-oidc-expanded-configuration.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,22 +278,20 @@ All other properties listed in the table above can be used to customize JWT clai
278278
In the typical OIDC client authentication case, the token audience defaults to the OIDC token endpoint address.
279279
When `quarkus.oidc.credentials.jwt.source` is `spiffe-jwt`, it defaults to `quarkus.oidc.auth-server-url`.
280280

281+
==== JWT Bearer and SPIFFE JWT-SVID
281282

282-
==== JWT Bearer
283-
284-
By default, when a client JWT authentication token must be produced, it is generated by Quarkus OIDC. In some cases, the JWT bearer token may be provided and periodically updated by Kubernetes.
283+
By default, when a client JWT authentication token must be produced, it is generated by Quarkus OIDC. A JWT token may also be provided and periodically updated by Kubernetes or SPIFFE Spire agent.
285284

286285
.JWT source properties
287286
[options="header"]
288287
|====
289288
|Property name |Default |Description
290289

291290
|quarkus.oidc.credentials.jwt.source |Generated by quarkus-oidc| How the authentication JWT token is produced
292-
|quarkus.oidc.credentials.jwt.token-path ||If the token source is BEARER then this path must point to a JWT bearer token in the file system
291+
|quarkus.oidc.credentials.jwt.token-path ||Must point to a token file when the source is `bearer` but is optional when the source is `spiffe-jwt`
293292
|====
294293

295294
Set `quarkus.oidc.credentials.jwt.source=bearer` if the client authentication token is provided by Kubernetes, and use `quarkus.oidc.credentials.jwt.token-path` to point to the file resource containing this token.
296-
Set `quarkus.oidc.credentials.for-all-endpoints=true` when the OIDC provider enforces authenticated access to the discovery and JWKS endpoints. See xref:security-oidc-code-flow-authentication.adoc#authenticated-access-to-all-oidc-endpoints[Authenticated access to all OIDC endpoints] for more information.
297295

298296
Set `quarkus.oidc.credentials.jwt.source=spiffe-jwt` to use a SPIFFE JWT-SVID token as the client assertion.
299297
When `quarkus.oidc.credentials.jwt.token-path` is set, the token is read from the file system and reloaded when it expires.
@@ -321,6 +319,10 @@ When the tokens must be introspected, some providers may require the introspecti
321319

322320
Currently, introspection credentials, if configured, can only be sent as HTTP POST form parameters.
323321

322+
=== Authenticated access to all OIDC endpoints
323+
324+
Set `quarkus.oidc.credentials.for-all-endpoints=true` when the OIDC provider enforces authenticated access to the discovery and JWKS endpoints. See xref:security-oidc-code-flow-authentication.adoc#authenticated-access-to-all-oidc-endpoints[Authenticated access to all OIDC endpoints] for more information.
325+
324326
[[connection-properties]]
325327
== Connection properties
326328

0 commit comments

Comments
 (0)