Skip to content

Commit 583c6fa

Browse files
authored
Merge pull request #51054 from sberyozkin/improve_oidc_bearer_token_tutorial
Make it clearer in OIDC bearer token tutorial when to copy the realm file
2 parents 0c51298 + 94f76e8 commit 583c6fa

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

docs/src/main/asciidoc/security-oidc-bearer-token-authentication-tutorial.adoc

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,33 @@ For more information, see the <<bearer-token-tutorial-keycloak-dev-mode>> sectio
198198
For more information, see the Quarkus xref:security-oidc-configuration-properties-reference.adoc[OpenID Connect (OIDC) configuration properties] guide.
199199

200200

201-
== Start and configure the Keycloak server
201+
[[bearer-token-tutorial-keycloak-dev-mode]]
202+
== Run the application in dev mode
202203

203-
. Put the link:{quickstarts-tree-url}/security-openid-connect-quickstart/config/quarkus-realm.json[realm configuration file] on the classpath (`target/classes` directory) so that it gets imported automatically when running in dev mode.
204-
You do not need to do this if you have already built a link:{quickstarts-tree-url}/security-openid-connect-quickstart[complete solution], in which case, this realm file is added to the classpath during the build.
204+
Put the link:{quickstarts-tree-url}/security-openid-connect-quickstart/config/quarkus-realm.json[realm configuration file] in the `src/main/resources` application folder so that it gets copied to the classpath and imported automatically to Keycloak. You do not need to do this if you have already built a link:{quickstarts-tree-url}/security-openid-connect-quickstart[complete solution], in which case, this realm file is added to the classpath during the build.
205+
206+
. To run the application in dev mode, run the following commands:
205207
+
208+
====
209+
include::{includes}/devtools/dev.adoc[]
210+
====
211+
* xref:security-openid-connect-dev-services.adoc[Dev Services for Keycloak] will start a Keycloak container and import a `quarkus-realm.json`.
212+
. Open a xref:dev-ui.adoc[Dev UI], which you can find at http://localhost:8080/q/dev-ui[/q/dev-ui].
213+
Then, in an `OpenID Connect` card, click the `Keycloak provider` link .
214+
. When prompted to log in to a `Single Page Application` provided by `OpenID Connect Dev UI`, do the following steps:
215+
216+
* Log in as `alice` (password: `alice`), who has a `user` role.
217+
** Accessing `/api/admin` returns a `403` status code.
218+
** Accessing `/api/users/me` returns a `200` status code.
219+
* Log out and log in again as `admin` (password: `admin`), who has both `admin` and `user` roles.
220+
** Accessing `/api/admin` returns a `200` status code.
221+
** Accessing `/api/users/me` returns a `200` status code.
222+
223+
== Start and configure the Keycloak server
224+
206225
[NOTE]
207226
====
208-
Do not start the Keycloak server when you run the application in dev mode; `Dev Services for Keycloak` will start a container.
227+
Do not start the Keycloak server when you <<bearer-token-tutorial-keycloak-dev-mode,run the application in dev mode>>; `Dev Services for Keycloak` will start and configure a container.
209228
For more information, see the <<bearer-token-tutorial-keycloak-dev-mode>> section.
210229
====
211230
+
@@ -245,31 +264,8 @@ For more information, see the xref:security-keycloak-admin-client.adoc[Quarkus K
245264
endif::no-quarkus-keycloak-admin-client[]
246265

247266

248-
249-
[[bearer-token-tutorial-keycloak-dev-mode]]
250-
== Run the application in dev mode
251-
252-
. To run the application in dev mode, run the following commands:
253-
+
254-
====
255-
include::{includes}/devtools/dev.adoc[]
256-
====
257-
* xref:security-openid-connect-dev-services.adoc[Dev Services for Keycloak] will start a Keycloak container and import a `quarkus-realm.json`.
258-
. Open a xref:dev-ui.adoc[Dev UI], which you can find at http://localhost:8080/q/dev-ui[/q/dev-ui].
259-
Then, in an `OpenID Connect` card, click the `Keycloak provider` link .
260-
. When prompted to log in to a `Single Page Application` provided by `OpenID Connect Dev UI`, do the following steps:
261-
262-
* Log in as `alice` (password: `alice`), who has a `user` role.
263-
** Accessing `/api/admin` returns a `403` status code.
264-
** Accessing `/api/users/me` returns a `200` status code.
265-
* Log out and log in again as `admin` (password: `admin`), who has both `admin` and `user` roles.
266-
** Accessing `/api/admin` returns a `200` status code.
267-
** Accessing `/api/users/me` returns a `200` status code.
268-
269267
== Run the Application in JVM mode
270268

271-
When you are done with dev mode, you can run the application as a standard Java application.
272-
273269
. Compile the application:
274270
+
275271
====

0 commit comments

Comments
 (0)