Demo: switching Shop to Keycloak-issued tokens
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
replace self-issued tokens with Keycloak tokens. Prepares JNR-039-LAB1.
Draft outline details
Step by step
- Remove the self-issued login endpoint and key from Shop.
- Set
issuer-urito the Keycloak realm. - Add a converter that maps realm roles to
ROLE_authorities. - Call the API with a Keycloak token and see
200for customer and admin as expected. - Planned mistake: sending the ID token to the API. Explain why the audience or claims do not fit, and use the access token.
- Confirm an old self-issued token now returns 401.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.