Step 1 - Start and configure Keycloak
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
In this part we will setup Keycloak. We will run a local Keycloak Docker container and reuse an existing realm configuration.
The image below shows the relevant elements we will use later.
git clone https://github.com/thomassuedbroecker/get-started-with-keycloak-microprofile-openliberty.git
cd get-started-with-keycloak-microprofile-openliberty
ROOT_FOLDER=$(pwd)
Open a terminal session and enter:
docker run -it -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -p 8282:8080 jboss/keycloak:9.0.2
Open the Keycloak in a browser select the Administration Console
Use following URL:
http://localhost:8282/
Login to using the URL in your browser with user/admin
and password/admin
Select Add realm
Choose for import Select file
Select existing realm
configuration from folder /keycloak-realm-exports/cloud-native-starter-author-local-realm-export.json
cd $ROOT_FOLDER/keycloak-realm-exports
Press Create
cloudnativestarter
The realm cloudnativestarter
uses a OpenID Endpoint configuration..
The Key has the JavaWebToken (JWT) format and uses the RS256 asymmetric algorithm.
"RS256 (RSA Signature with SHA-256) is an asymmetric algorithm, and it uses a public/private key pair: the identity provider has a private (secret) key used to generate the signature, and the consumer of the JWT gets a public key to validate the signature. Since the public key, as opposed to the private key, doesn't need to be kept secured, most identity providers make it easily available for consumers to obtain and use (usually through a metadata URL)." Resource of this text
Definition of the authors-cloud-native-starter
client.
Definition of the role authors-role-cloud-native-starter
.
Definition of the group authors-cloud-native-starter
.
The definition of the role authors-role-cloud-native-starter
to the group authors-cloudnativestarter
mapping.
author-cloud-native-starter
1234
Select in user Author-cloud-native-starter the tab Groups
and join in _Available Groups_
the _authors-cloudnativestarter_
as you see in the image below.