Closed Jomy10 closed 1 year ago
Hey @Jomy10, apologies for our delay in getting back to you here. Running your provided code I only get the error you mentioned when the EMAIL_API_AUTH0_DOMAIN
environment variable is not provided. Can you confirm that this is present wherever you are running your code?
Hi, I ended up using something else for this project, but I do remember checking if the environment variable was present by printing it out, which worked
It's curious that it printed out just fine, but didn't construct the URL correctly.
Given that I can't reproduce this and it seems the issue lies more in configuration as the URL was constructed before being passed to jwks.NewCachingProvider
I'm going to close this issue out. Thank you for filing this issue.
Checklist
Description
I get the error
An error occured while validating JWT: jwt invalid: error getting the keys from the key func: could not get well known endpoints from url https:///.well-known/openid-configuration: Get "https:///.well-known/openid-configuration": http: no Host in request URL
when trying to use the JWT middleware.Reproduction
I have the following middleware:
I generate a JWK token:
I then use it in a request that uses this middleware:
This gives me as response:
{"message":"Failed to validate JWT."}
, while on the server I getAAn error occured while validating JWT: jwt invalid: error getting the keys from the key func: could not get well known endpoints from url https:///.well-known/openid-configuration: Get "https:///.well-known/openid-configuration": http: no Host in request URL
.Go JWT Middleware version
v2.0.0
Go version
1.19.4 linux/amd64