Skip to content
Ameen Abozaid
Planned lessonJNR-039-L06

Spring as a resource server

  • Lesson 6 of 8
  • Junior
On This Lesson 4 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

make the Shop API trust an external authorization server.

Planned topics

  • Add the OAuth2 resource server starter.
  • Set spring.security.oauth2.resourceserver.jwt.issuer-uri; Spring discovers the keys from the issuer.
  • Spring validates signature, issuer, and expiry; add an audience check as extra validation.
  • Map token claims (such as Keycloak realm roles) to Spring authorities with a JwtAuthenticationConverter.
  • The API never handles passwords.
Draft outline details

Demonstration

yaml
spring:
  security:
    oauth2:
      resourceserver:
        jwt:
          issuer-uri: http://localhost:8081/realms/shop

Check your understanding

Where does Spring get the public keys from?

Show answer

From the issuer's discovery and JWKS endpoints.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.