[keycloak-user] Spring Boot REST Service Example(s)

Jeremy Simon jeremy at jeremysimon.com
Thu Jan 14 18:44:53 EST 2016


Hi,

Would anyone be willing to point me to some good working examples that
are REST services built with Spring Boot but can leverage Keycloak for
authentication?  I had no trouble integrating a webapp with the SAML
protocol, but this OpenID Connect (/Oauth2?) area of things is really
confusing.

All I'm trying to do is security the REST endpoints I made and then
when I actually hit a controller, also be able to pull some role or
attribute information off the Authentication token.

I tried to cobble together something using the reference guide and the
adaptors sections, but to no avail.  In particular I followed the 8.9
Spring Boot Adaptor but I get 302s and a this in the response if i try
a rest client...

----
302 Found

form

HEADERS
Content-Length:0 Bytes
Date:
2016 Jan 14 18:41:13
Location:http://localhost:11080/auth/realms/jeremy/protocol/openid-connect/auth?response_type=code&client_id=try&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fadmin&state=1%2F82011a10-3b29-44eb-9801-e723c03c94bf&login=true
S

----

At any rate, I tried some extra spring security and other mentions
down further in the guide, but I'm definitely digging myself into a
little hole!  Any help would be greatly appreciated!

Possibly uneducated guess with this subject, can Spring Security OAuth
be used with this?  Probably can't with the OpenID JWT responses?

jeremy
jeremy at jeremysimon.com
www.JeremySimon.com


More information about the keycloak-user mailing list