Exercise 2 - Change code, build, save and deploy the Authors Microservice
Step 1: Open the server.xml file
server.xml fileecho $keycloakurl
cd $ROOT_FOLDER/authors-java-jee-cloud/liberty
nano server.xmlStep 2: Change following source code
<mpJwt
id="myMpJwt"
jwksUri="[keycloakurl]/auth/realms/cloudnativestarter/protocol/openid-connect/certs"
issuer="[keycloakurl]/auth/realms/cloudnativestarter"
userNameAttribute="preferred_username"
audiences="account">
</mpJwt>Step 3: Open the microprofile-config.properties file
microprofile-config.properties filecd $ROOT_FOLDER/authors-java-jee-cloud/src/webapp/META-INF
nano microprofile-config.propertiesStep 4: Change following source code
Step 5: Insert the RS256 JWT key in the file keycloak-public-key.pem
keycloak-public-key.pem
Step 6: Build and save the "Authors" container image in the IBM Cloud Container Registry
Step 7: List the container images to verify the upload.
Step 8: Apply the deployment of the Authors service
PreviousExercise 1 - Setup Keycloak on KubernetesNextExercise 3 - Change code, build, save and deploy the Web-App
Last updated