You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/security-oidc-expanded-configuration.adoc
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -604,14 +604,14 @@ Currently, only a `Cache-Control` `no-store` directive that prohibits caching th
604
604
After the authorization code flow is finished, ID token, access token, and refresh token must be retained to support the user session.
605
605
606
606
By defaut, Quarkus OIDC stores all three tokens in an encrypted session cookie, making Quarkus OIDC stateless.
607
-
Quarkus OIDC also provides the stateful xref:security-oidc-code-flow-authentication.adoc#db-token-state-manager[Database TokenStateManager] to store tokens in your database of choice and the xref:security-oidc-code-flow-authentication.adoc#redis-token-state-manager[Redis TokenStateManager] to store them in the Redis cache. Users can also register custom `quarkus.oidc.TokenStateManager` to store these tokens as required.
607
+
Quarkus OIDC also provides the stateful xref:security-oidc-code-flow-authentication.adoc#db-token-state-manager[Database TokenStateManager] to store tokens in your database of choice and the xref:security-oidc-code-flow-authentication.adoc#redis-token-state-manager[Redis TokenStateManager] to store them in the Redis cache. Users can also register custom `io.quarkus.oidc.TokenStateManager` to store these tokens as required.
608
608
609
609
.Default TokenStateManager
610
610
[options="header"]
611
611
|====
612
612
|Property | Default |Description
613
613
614
-
|quarkus.oidc.token-state-manager.encryption-required |true| Encrypt session cookie by default
614
+
|quarkus.oidc.token-state-manager.encryption-required |true| Encrypt session cookie by default, also see the note below
615
615
|quarkus.oidc.token-state-manager.encryption-secret || Encryption secret, with falling back to the client secret and finally a generated secret key
|quarkus.oidc.token-state-manager.split-tokens |false| Cookie per token
@@ -632,6 +632,15 @@ For example, you can do `quarkus.oidc.token-state-manager.strategy=id-refresh-to
632
632
633
633
If your application does not need to use access tokens but only interact with the authenticated user who must always re-authenticate when the session expires, consider `quarkus.oidc.token-state-manager.strategy=idtoken` - which retains ID token only, ignoring both access and refresh tokens.
634
634
635
+
[NOTE]
636
+
====
637
+
`quarkus.oidc.token-state-manager.encryption-required` and two other related properties, `quarkus.oidc.token-state-manager.encryption-secret` and `quarkus.oidc.token-state-manager.encryption-algorithm`, are also effective when custom `io.quarkus.oidc.TokenStateManager` is used, including xref:security-oidc-code-flow-authentication.adoc#db-token-state-manager[Database TokenStateManager] and xref:security-oidc-code-flow-authentication.adoc#redis-token-state-manager[Redis TokenStateManager].
638
+
639
+
Given that `quarkus.oidc.token-state-manager.encryption-required` is set to `true` by default, a custom `io.quarkus.oidc.TokenStateManager` implementation must encrypt tokens before storing them by default. However, it does not have to encrypt tokens itself, they will be encrypted by the time it is asked to store them.
640
+
641
+
A custom `io.quarkus.oidc.TokenStateManager` implementation that does not want tokens encrypted by default can disable it with `quarkus.oidc.token-state-manager.encryption-required=false`.
642
+
====
643
+
635
644
[[logout-properties]]
636
645
== Logout
637
646
@@ -1231,7 +1240,7 @@ You can register a `quarkus.oidc.UserInfoCache` provider to support a custom `Us
1231
1240
=== TokenStateManager
1232
1241
1233
1242
As discussed in the <<token-state-manager>> section above, Quarkus OIDC already provides stateless (default) and stateful options for storing authorization code flow tokens.
1234
-
You can also provide your own custom `quarkus.oidc.TokenStateManager` implementation.
1243
+
You can also provide your own custom `io.quarkus.oidc.TokenStateManager` implementation.
Copy file name to clipboardExpand all lines: extensions/oidc-db-token-state-manager/deployment/src/main/java/io/quarkus/oidc/db/token/state/manager/OidcDbTokenStateManagerProcessor.java
Copy file name to clipboardExpand all lines: extensions/oidc-db-token-state-manager/deployment/src/test/java/io/quarkus/oidc/db/token/state/manager/AbstractDbTokenStateManagerTest.java
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ public void testCodeFlow() throws IOException {
Copy file name to clipboardExpand all lines: extensions/oidc-db-token-state-manager/deployment/src/test/java/io/quarkus/oidc/db/token/state/manager/HibernateOrmPgDbTokenStateManagerTest.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,11 @@ public void testCodeFlowOnTableNotCreatedByExtension() throws IOException {
Copy file name to clipboardExpand all lines: extensions/oidc-db-token-state-manager/deployment/src/test/java/io/quarkus/oidc/db/token/state/manager/PublicResource.java
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
importjakarta.ws.rs.GET;
9
9
importjakarta.ws.rs.Path;
10
10
11
+
importio.quarkus.oidc.runtime.OidcUtils;
11
12
importio.smallrye.mutiny.Uni;
12
13
importio.vertx.sqlclient.Pool;
13
14
importio.vertx.sqlclient.Row;
@@ -41,4 +42,30 @@ public Long apply(RowSet<Row> rows) {
41
42
.toCompletionStage());
42
43
}
43
44
45
+
@Path("/db-state-manager-tokens")
46
+
@GET
47
+
publicUni<String> getDbStateManagerTokens() {
48
+
returnUni.createFrom().completionStage(pool
49
+
.query("SELECT id_token, access_token, refresh_token FROM oidc_db_token_state_manager")
0 commit comments