Skip to content

Instantly share code, notes, and snippets.



Created Mar 20, 2021
What would you like to do?
func getJWKKey(token *jwt.Token) (interface{}, error) {
kid := fmt.Sprintf("%v", token.Header["kid"])
set, err := jwk.FetchHTTP(jwkKeyURL)
if err != nil {
log.Printf("failed to parse JWK: %s", err)
return nil, err
keys := set.LookupKeyID(kid)
var publicKey interface{}
return publicKey, nil
func fetchClaim(token string) *EVEClaim {
claim := &EVEClaim{}
_, err := jwt.ParseWithClaims(token, claim, getJWKKey)
if err != nil {
return claim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment