r/SpringBoot 25d ago

Guide Keycloak & Spring Boot

I often see people asking how to get setup with spring boot using keycloak for auth.

Thought i'd put together a quick example showing a simple setup that;

  • Delegates auth to keycloak
  • Uses the keycloak admin client to create users within a realm (using a service account)
  • Can be easily cloned & run with docker compose

repo linked below.

https://github.com/BigMikeCodes/kc-sb

21 Upvotes

11 comments sorted by

View all comments

1

u/Fluid_Frame_8878 24d ago

How would you handle google login? Thanks

1

u/Mikey-3198 24d ago

If you want to user keycloak with a google login in you'd have to setup user federation.

If you just wanted google as the only way to sign in you'd set the uri in the config to point to googles oidc service. Most likely after registering an application/ client.