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: documentation/modules/ROOT/pages/openid-jwt.adoc
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@ include::_attributes.adoc[]
3
3
4
4
This tutorial demonstrates how to implement an OpenID Connect flow with a JWT implementation.
5
5
6
-
We will set up a new realm in Red Hat Build for Keycloak (RHBK) and configure it. Subsequently, we will deploy the stack and configure user access, enabling roles for various operations.
6
+
We will set up a new realm in Red Hat Build for Keycloak and configure it. Subsequently, we will deploy the stack and configure user access, enabling roles for various operations.
7
7
8
8
[#architecture]
9
9
== Architecture
10
10
11
-
Firstly, we require an instance of RHBK to manage access across our applications. One advantage of implementing OpenID Connect with JWT is the seamless integration of various applications and frameworks, facilitated by libraries available for each.
11
+
Firstly, we require an instance of Red Hat Build for Keycloak to manage access across our applications. One advantage of implementing OpenID Connect with JWT is the seamless integration of various applications and frameworks, facilitated by libraries available for each.
12
12
13
13
In this instance, we will construct a comprehensive architecture involving several microservices. The frontend is developed in ReactJS, responsible for displaying the data.
14
14
@@ -17,19 +17,19 @@ The user backend microservice, built with Quarkus, showcases a straightforward i
17
17
image::openid/frontend-architecture-01.png[]
18
18
19
19
[#rhbk]
20
-
== RHBK configuration
20
+
== Red Hat Build for Keycloak configuration
21
21
22
22
This section outlines the process of creating a new realm using the OpenID Connect flow and provides guidance on its configuration.
23
23
24
24
=== Create a realm
25
25
26
-
A realm in RHBK functions as a domain where clients, users, roles, etc., can be configured. In this example, we offer an import containing the configuration to execute this workshop. Nevertheless, we are creating one from scratch to illustrate all the processes:
26
+
A realm in Red Hat Build for Keycloak functions as a domain where clients, users, roles, etc., can be configured. In this example, we offer an import containing the configuration to execute this workshop. Nevertheless, we are creating one from scratch to illustrate all the processes:
27
27
28
28
image::openid/rhbk-create-realm-01.png[]
29
29
30
30
=== Create a client
31
31
32
-
A client in RHBK serves as a consumer. Since we are employing an OpenID Connect flow, the selection of a standard or implicit flow depends on whether we are configuring a private or public client.
32
+
A client in Red Hat Build for Keycloak serves as a consumer. Since we are employing an OpenID Connect flow, the selection of a standard or implicit flow depends on whether we are configuring a private or public client.
33
33
34
34
To register a new client, navigate to the Keycloak admin console and access the client options. In this section, locate the "Create client" option.
35
35
@@ -61,19 +61,19 @@ The front-end application consumes the back-end application, and it is crucial t
61
61
oc get route -A | grep ms-users | awk '{print $3}'
62
62
----
63
63
64
-
=== RHBK configuration
64
+
=== Red Hat Build for Keycloak configuration
65
65
66
66
The Keycloak instance includes a realm that has been configured with a dedicated client tailored for this workshop.
67
67
68
68
This application functions as a backend service utilizing a standard flow with a private client. In the upcoming section, you will find all the necessary configurations.
69
69
70
-
If you want to review the OpenID Connect client configuration and explore the RHBK admin console, please navigate to the following section.
70
+
If you want to review the OpenID Connect client configuration and explore the Red Hat Build for Keycloak admin console, please navigate to the following section.
71
71
72
72
image::openid/backend-rhbk-config-01.png[]
73
73
74
74
=== Quarkus configuration
75
75
76
-
Quarkus streamlines the security configuration in our backend services. To achieve this, we need to import the corresponding library. In this case, even though we are working with RHBK, since it follows the OpenID Connect protocol, we will utilize the `quarkus-oidc` generic library.
76
+
Quarkus streamlines the security configuration in our backend services. To achieve this, we need to import the corresponding library. In this case, even though we are working with Red Hat Build for Keycloak, since it follows the OpenID Connect protocol, we will utilize the `quarkus-oidc` generic library.
77
77
78
78
[.lines_space]
79
79
[.console-input]
@@ -121,7 +121,7 @@ The level of security required varies depending on the operation. In this case,
121
121
122
122
We will employ the `curl` bash client to test the remaining endpoints of the application. If you prefer a more visual approach, you can skip this section and proceed directly to the front-end application section.
123
123
124
-
To obtain an access token, we need to configure certain parameters that RHBK requires.
124
+
To obtain an access token, we need to configure certain parameters that Red Hat Build for Keycloak requires.
125
125
126
126
[NOTE,subs="bash,+macros"]
127
127
====
@@ -251,7 +251,7 @@ This message indicates that you have not logged into the application. So we have
251
251
252
252
=== Create the user
253
253
254
-
The initial step is to create a new user to demonstrate the entire configuration step by step. To do this, enter the RHBK admin console, navigate to the "users" section, and click the "add user" button.
254
+
The initial step is to create a new user to demonstrate the entire configuration step by step. To do this, enter the Red Hat Build for Keycloak admin console, navigate to the "users" section, and click the "add user" button.
At this point, we understand how the ReactJS security model relies on the user roles present in the JWT token.
336
336
337
-
Now, let's proceed to add roles to users to enable private actions. The initial step is to return to the RHBK admin page and locate the user named `reader`. Once you have identified the user, navigate to the "Role mapping" tab.
337
+
Now, let's proceed to add roles to users to enable private actions. The initial step is to return to the Red Hat Build for Keycloak admin page and locate the user named `reader`. Once you have identified the user, navigate to the "Role mapping" tab.
338
338
339
339
image::openid/frontend-add-role-01.png[]
340
340
341
-
After clicking the "Assign role" button, RHBK will display a list of all available roles in the system.
341
+
After clicking the "Assign role" button, Red Hat Build for Keycloak will display a list of all available roles in the system.
342
342
343
343
Select the role "padel-player" and click the "Assign" button.
0 commit comments