auth0-golang-jwt
auth0-golang-jwt copied to clipboard
Compiler error in main.go:49
If I try to compile the demo, I get the following error:
PS C:\dev\auth0-golang-jwt-master> go run main.go
# command-line-arguments
.\main.go:49: cannot use audience (type string) as type []string in argument to auth0.NewConfiguration
PS C:\dev\auth0-golang-jwt-master>
The line
configuration := auth0.NewConfiguration(secretProvider, audience, "https://{YOUR-AUTH0-DOMAIN}.auth0.com/", jose.HS256)
needs to be changed in this way:
configuration := auth0.NewConfiguration(secretProvider, []string{audience}, "https://{YOUR-AUTH0-DOMAIN}.auth0.com/", jose.HS256)
The above solution worked for me. I was compiling on localhost Windows 7 machine, noticed OP had a Windows directory in his error - maybe relevant.
FOR ME TOO