Micah Parks
Jul 22, 2022

I've written a Go package for this use case. Since Keycloak exposes a JSON Web Key Set, JWKS, it can be retrieved, parsed, and cached to verify JWTs without a complete round trip. A short lived cache of a minute or less should fit most use cases and significantly speed up the response time of a server. There's also some other custom options to configure the behavior.

The package is "github.com/MicahParks/keyfunc". Here's a link to the example from the repository for Keycloak token authentication: https://github.com/MicahParks/keyfunc/blob/master/examples/keycloak/main.go

Micah Parks
Micah Parks

No responses yet