Skip to content

Commit 94f76e8

Browse files
committed
Make it clearer in OIDC bearer token tutorial when to copy the realm file
1 parent 365da76 commit 94f76e8

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
+
@@ -246,31 +265,8 @@ For more information, see the xref:security-keycloak-admin-client.adoc[Quarkus K
246265
endif::no-quarkus-keycloak-admin-client[]
247266

248267

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

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

0 commit comments

Comments
 (0)