From ee47731e30f52ffc761c7d3e2acadb6199d85e64 Mon Sep 17 00:00:00 2001 From: Jakub Jedlicka Date: Tue, 21 Jan 2025 15:29:47 +0100 Subject: [PATCH] Update Keycloak SPA example as the current one wasn't working --- ...rity-oidc-bearer-token-authentication.adoc | 39 +++++++++++++++---- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc index 0e3c6a1bfe588..ab1ee4e5c4024 100644 --- a/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc +++ b/docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc @@ -411,14 +411,28 @@ For example, if you work with Keycloak, you can use `keycloak.js` to authenticat keycloak-spa - - + - + ---- +[NOTE] +==== +To enable authentication for this SPA Keycloak example, disable *Client authentication* and set *Web origins* to `http://localhost:8080`. These settings allow Keycloak's CORS policy to communicate with your Quarkus application. +The code provides an example of building Quarkus single-page applications integrated with Keycloak. For more details about creating single-page applications integrating Keycloak, refer to the official link:https://www.keycloak.org/securing-apps/javascript-adapter[Keycloak JavaScript adapter documentation]. +==== + === Cross-origin resource sharing If you plan to use your OIDC `service` application from a single-page application running on a different domain, you must configure cross-origin resource sharing (CORS).