Can someone tell me why the following (from https://github.com/dgrijalva/jwt-go ) example does not work?
token, err := jwt.Parse(myToken, func(token *jwt.Token) ([]byte, error) { return myLookupKey(token.Header["kid"]) }) if err == nil && token.Valid { deliverGoodness("!") } else { deliverUtterRejection(":(") }
I get the error message "I can not use the func literal (type func (* jwt.Token) ([] byte, error)) as the type jwt.Keyfunc in the jwt.Parse argument"
I tried to use the code from several different jwt-go examples, but always got the same error.
source share