Skip to content

Commit c3c5881

Browse files
committed
Sync documentation of main branch
1 parent e1e10ff commit c3c5881

File tree

4 files changed

+159
-0
lines changed

4 files changed

+159
-0
lines changed

_generated-doc/main/config/quarkus-all-config.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68352,6 +68352,34 @@ endif::add-copy-button-to-env-var[]
6835268352
|boolean
6835368353
|`false`
6835468354

68355+
a| [[quarkus-oidc_quarkus-oidc-token-binding-certificate]] [.property-path]##link:#quarkus-oidc_quarkus-oidc-token-binding-certificate[`quarkus.oidc.token.binding.certificate`]##
68356+
ifdef::add-copy-button-to-config-props[]
68357+
config_property_copy_button:+++quarkus.oidc.token.binding.certificate+++[]
68358+
endif::add-copy-button-to-config-props[]
68359+
68360+
68361+
`quarkus.oidc."tenant".token.binding.certificate`
68362+
ifdef::add-copy-button-to-config-props[]
68363+
config_property_copy_button:+++quarkus.oidc."tenant".token.binding.certificate+++[]
68364+
endif::add-copy-button-to-config-props[]
68365+
68366+
[.description]
68367+
--
68368+
If a bearer access token must be bound to the client mTLS certificate. It requires that JWT tokens must contain a confirmation `cnf` claim with a SHA256 certificate thumbprint matching the client mTLS certificate's SHA256 certificate thumbprint.
68369+
68370+
For opaque tokens, SHA256 certificate thumbprint must be returned in their introspection response.
68371+
68372+
68373+
ifdef::add-copy-button-to-env-var[]
68374+
Environment variable: env_var_with_copy_button:+++QUARKUS_OIDC_TOKEN_BINDING_CERTIFICATE+++[]
68375+
endif::add-copy-button-to-env-var[]
68376+
ifndef::add-copy-button-to-env-var[]
68377+
Environment variable: `+++QUARKUS_OIDC_TOKEN_BINDING_CERTIFICATE+++`
68378+
endif::add-copy-button-to-env-var[]
68379+
--
68380+
|boolean
68381+
|`false`
68382+
6835568383

6835668384
h|[[quarkus-oidc_section_quarkus-oidc-logout]] [.section-name.section-level0]##link:#quarkus-oidc_section_quarkus-oidc-logout[RP-initiated, back-channel and front-channel logout configuration]##
6835768385
h|Type

_generated-doc/main/config/quarkus-oidc.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,34 @@ endif::add-copy-button-to-env-var[]
23862386
|boolean
23872387
|`false`
23882388

2389+
a| [[quarkus-oidc_quarkus-oidc-token-binding-certificate]] [.property-path]##link:#quarkus-oidc_quarkus-oidc-token-binding-certificate[`quarkus.oidc.token.binding.certificate`]##
2390+
ifdef::add-copy-button-to-config-props[]
2391+
config_property_copy_button:+++quarkus.oidc.token.binding.certificate+++[]
2392+
endif::add-copy-button-to-config-props[]
2393+
2394+
2395+
`quarkus.oidc."tenant".token.binding.certificate`
2396+
ifdef::add-copy-button-to-config-props[]
2397+
config_property_copy_button:+++quarkus.oidc."tenant".token.binding.certificate+++[]
2398+
endif::add-copy-button-to-config-props[]
2399+
2400+
[.description]
2401+
--
2402+
If a bearer access token must be bound to the client mTLS certificate. It requires that JWT tokens must contain a confirmation `cnf` claim with a SHA256 certificate thumbprint matching the client mTLS certificate's SHA256 certificate thumbprint.
2403+
2404+
For opaque tokens, SHA256 certificate thumbprint must be returned in their introspection response.
2405+
2406+
2407+
ifdef::add-copy-button-to-env-var[]
2408+
Environment variable: env_var_with_copy_button:+++QUARKUS_OIDC_TOKEN_BINDING_CERTIFICATE+++[]
2409+
endif::add-copy-button-to-env-var[]
2410+
ifndef::add-copy-button-to-env-var[]
2411+
Environment variable: `+++QUARKUS_OIDC_TOKEN_BINDING_CERTIFICATE+++`
2412+
endif::add-copy-button-to-env-var[]
2413+
--
2414+
|boolean
2415+
|`false`
2416+
23892417

23902418
h|[[quarkus-oidc_section_quarkus-oidc-logout]] [.section-name.section-level0]##link:#quarkus-oidc_section_quarkus-oidc-logout[RP-initiated, back-channel and front-channel logout configuration]##
23912419
h|Type

_generated-doc/main/config/quarkus-oidc_quarkus.oidc.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,34 @@ endif::add-copy-button-to-env-var[]
23862386
|boolean
23872387
|`false`
23882388

2389+
a| [[quarkus-oidc_quarkus-oidc-token-binding-certificate]] [.property-path]##link:#quarkus-oidc_quarkus-oidc-token-binding-certificate[`quarkus.oidc.token.binding.certificate`]##
2390+
ifdef::add-copy-button-to-config-props[]
2391+
config_property_copy_button:+++quarkus.oidc.token.binding.certificate+++[]
2392+
endif::add-copy-button-to-config-props[]
2393+
2394+
2395+
`quarkus.oidc."tenant".token.binding.certificate`
2396+
ifdef::add-copy-button-to-config-props[]
2397+
config_property_copy_button:+++quarkus.oidc."tenant".token.binding.certificate+++[]
2398+
endif::add-copy-button-to-config-props[]
2399+
2400+
[.description]
2401+
--
2402+
If a bearer access token must be bound to the client mTLS certificate. It requires that JWT tokens must contain a confirmation `cnf` claim with a SHA256 certificate thumbprint matching the client mTLS certificate's SHA256 certificate thumbprint.
2403+
2404+
For opaque tokens, SHA256 certificate thumbprint must be returned in their introspection response.
2405+
2406+
2407+
ifdef::add-copy-button-to-env-var[]
2408+
Environment variable: env_var_with_copy_button:+++QUARKUS_OIDC_TOKEN_BINDING_CERTIFICATE+++[]
2409+
endif::add-copy-button-to-env-var[]
2410+
ifndef::add-copy-button-to-env-var[]
2411+
Environment variable: `+++QUARKUS_OIDC_TOKEN_BINDING_CERTIFICATE+++`
2412+
endif::add-copy-button-to-env-var[]
2413+
--
2414+
|boolean
2415+
|`false`
2416+
23892417

23902418
h|[[quarkus-oidc_section_quarkus-oidc-logout]] [.section-name.section-level0]##link:#quarkus-oidc_section_quarkus-oidc-logout[RP-initiated, back-channel and front-channel logout configuration]##
23912419
h|Type

_versions/main/guides/security-oidc-bearer-token-authentication.adoc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,81 @@ If you set `quarkus.oidc.client-id`, but your endpoint does not require remote a
12441244
Quarkus `web-app` applications always require the `quarkus.oidc.client-id` property.
12451245
====
12461246

1247+
== Mutual TLS token binding
1248+
1249+
https://datatracker.ietf.org/doc/html/rfc8705[RFC8705] describes a mechanism for binding access tokens to Mutual TLS (mTLS) client authentication certificates.
1250+
It requires that a client certificate's SHA256 thumbprint matches a JWT token or token introspection confirmation `x5t#S256` certificate thumbprint.
1251+
1252+
For example, see https://datatracker.ietf.org/doc/html/rfc8705#section-3.1[JWT Certificate Thumbprint Confirmation Method] and https://datatracker.ietf.org/doc/html/rfc8705#section-3.2[Confirmation Method for Token Introspection] sections of https://datatracker.ietf.org/doc/html/rfc8705[RFC8705].
1253+
1254+
MTLS token binding supports a `holder of key` concept, and can be used to confirm that the current access token was issued to the current authenticated client who presents this token.
1255+
1256+
When you use both mTLS and OIDC bearer authentication mechanisms, you can enforce that the access tokens must be certificate bound with a single property, after configuring your Quarkus endpoint and Quarkus OIDC to require the use of mTLS.
1257+
1258+
For example:
1259+
1260+
[source,properties]
1261+
----
1262+
quarkus.oidc.auth-server-url=${your_oidc_provider_url}
1263+
quarkus.oidc.token.binding.certificate=true <1>
1264+
quarkus.oidc.tls.tls-configuration-name=oidc-client-tls <2>
1265+
1266+
quarkus.tls.oidc-client-tls.key-store.p12.path=target/certificates/oidc-client-keystore.p12 <2>
1267+
quarkus.tls.oidc-client-tls.key-store.p12.password=password
1268+
quarkus.tls.oidc-client-tls.trust-store.p12.path=target/certificates/oidc-client-truststore.p12
1269+
quarkus.tls.oidc-client-tls.trust-store.p12.password=password
1270+
1271+
quarkus.http.tls-configuration-name=oidc-server-mtls <3>
1272+
quarkus.tls.oidc-server-mtls.key-store.p12.path=target/certificates/oidc-keystore.p12
1273+
quarkus.tls.oidc-server-mtls.key-store.p12.password=password
1274+
quarkus.tls.oidc-server-mtls.trust-store.p12.path=target/certificates/oidc-server-truststore.p12
1275+
quarkus.tls.oidc-server-mtls.trust-store.p12.password=password
1276+
----
1277+
<1> Require that bearer access tokens must be bound to the client certificates.
1278+
<2> TLS registry configuration for Quarkus OIDC be able to communicate with the OIDC provider over MTLS
1279+
<3> TLS registry configuration requiring external clients to authenticate to the Quarkus endpoint over MTLS
1280+
1281+
The above configuration is sufficient to require that OIDC bearer tokens are bound to the client certificates.
1282+
1283+
Next, if you need to access both mTLS and OIDC bearer security identities, consider enabling xref:security-authentication-mechanisms#combining-authentication-mechanisms[Inclusive authentication] with `quarkus.http.auth.inclusive=true`.
1284+
1285+
Now you can access both MTLS and OIDC security identities as follows:
1286+
1287+
[source,java]
1288+
----
1289+
package io.quarkus.it.oidc;
1290+
1291+
import jakarta.inject.Inject;
1292+
import jakarta.ws.rs.GET;
1293+
import jakarta.ws.rs.Path;
1294+
1295+
import org.eclipse.microprofile.jwt.JsonWebToken;
1296+
import io.quarkus.security.Authenticated;
1297+
import io.quarkus.security.credential.CertificateCredential;
1298+
import io.quarkus.security.identity.SecurityIdentity;
1299+
1300+
@Path("/service")
1301+
@Authenticated
1302+
public class OidcMtlsEndpoint {
1303+
1304+
@Inject
1305+
SecurityIdentity mtlsIdentity; <1>
1306+
1307+
@Inject
1308+
JsonWebToken oidcAccessToken; <2>
1309+
1310+
@GET
1311+
public String getIdentities() {
1312+
var cred = identity.getCredential(CertificateCredential.class).getCertificate();
1313+
return "Identities: " + cred.getSubjectX500Principal().getName().split(",")[0]
1314+
+ ", " + accessToken.getName();
1315+
}
1316+
}
1317+
----
1318+
<1> `SecurityIdentity` always represents the primary mTLS authentication when mTLS is used and an inclusive authentication is enabled.
1319+
<2> OIDC security identity is also available because enabling an inclusive authentication requires all registered mechanisms to produce the security identity.
1320+
1321+
12471322
== Authentication after an HTTP request has completed
12481323

12491324
Sometimes, `SecurityIdentity` for a given token must be created when there is no active HTTP request context.

0 commit comments

Comments
 (0)