{"repo":"MicahParks/keyfunc","free":true,"listed":false,"github":"https://github.com/MicahParks/keyfunc","clone":"git clone https://github.com/MicahParks/keyfunc.git","description":"Create a jwt.Keyfunc for JWT parsing with a JWK Set or given cryptographic keys (like HMAC) in Golang.","language":"Go","stars":410,"topics":["golang","jwt","go","jwks","jwk","jwkset","oidc"],"license":"Apache-2.0","category":"auth-billing-email","readme_excerpt":"keyfunc The purpose of this package is to provide a jwt.Keyfunc for the github.com/golang-jwt/jwt/v5 package using a JSON Web Key Set (JWK Set) for parsing and verifying JSON Web Tokens (JWTs). It's common for an identity providers, particularly those using OAuth 2.0 or OpenID Connect, such as Keycloak or Amazon Cognito (AWS) to expose a JWK Set via an HTTPS endpoint. This package has the ability to consume that JWK Set and produce a jwt.Keyfunc . It is important that a JWK Set endpoint is using HTTPS to ensure the keys are from the correct trusted source. Basic usage For complete examples, please see the examples directory. Step 1: Create the keyfunc.Keyfunc The below example is for a remote HTTP resource. See examples/json/main.go for a JSON example. When using the keyfunc.NewDefault function, the JWK Set will be automatically refreshed using jwkset.NewDefaultHTTPClient . This does launch a \" refresh goroutine\". If you want the ability to end this goroutine, use the keyfunc.NewDefaultCtx function. It is also possible to create a keyfunc.Keyfunc from given keys like HMAC shared secrets. See examples/hmac/main.go . Step 2: Use the keyfunc.Keyfunc to parse and verify JWTs Additional features This project's primary purpose is to provide a jwt.Keyfunc implementation for JWK Sets. Since version 3.X.X , this project has become a thin wrapper around github.com/MicahParks/jwkset. Newer versions contain a superset of features available in versions 2.X.X and earlier, but some of the d","default_branch":null,"files":null,"tree":[],"storefront":"/r/MicahParks","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MicahParks/keyfunc/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}