Skip to content

Instantly share code, notes, and snippets.

@quantonganh
Last active September 17, 2019 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantonganh/1ecfb7e3745c7de430ccf64aa4fd24ec to your computer and use it in GitHub Desktop.
Save quantonganh/1ecfb7e3745c7de430ccf64aa4fd24ec to your computer and use it in GitHub Desktop.
square/go-jose: error in cryptographic primitive

https://github.com/auth0-blog/auth0-golang-jwt/blob/master/main.go#L45

secret := []byte("{YOUR-AUTH0-API-SECRET}")
secretProvider := auth0.NewKeyProvider(secret)
audience := []string{"{YOUR-AUTH0-API-AUDIENCE}"}

configuration := auth0.NewConfiguration(secretProvider, audience, "https://{YOUR-AUTH0-DOMAIN}.auth0.com/", jose.HS256)
validator := auth0.NewValidator(configuration)

token, err := validator.ValidateRequest(r)

Make sure that secret is the "Signing Secret" in "APIs" instead of the "Client Secret" in "Applications".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment