Live Demo
"Sign in with your wallet" in a stock Spring Boot app.
This page is protected by Spring Security's standard oauth2Login(), pointed
at the Easit gateway like any other OAuth2 provider. No OpenID4VP code on the client side -
just a client registration and a user service that reads the gateway's token
introspection response.
Try it
You'll be sent to the gateway to scan a QR code with your EUDI wallet. Once you share
your PID, Spring Security completes the login and you land on a protected page that
greets you by the family name returned from /gateway/introspect.
What's behind it
Client registration
Authorization URI /gateway/authorize, token URI /gateway/token,
client_secret_basic - the same settings you'd give any OAuth2 provider.
Introspection as user info
The gateway isn't an OpenID Connect provider, so a small OAuth2UserService calls
/gateway/introspect and turns credential_claims into the
user's attributes.
Ordinary controller
The protected page reads family_name with
@AuthenticationPrincipal OAuth2User, like any other Spring login.
Want the raw HTTP calls instead? See the hand-written OAuth demo.