auth0-golang-jwt icon indicating copy to clipboard operation
auth0-golang-jwt copied to clipboard

Compiler error in main.go:49

Open Vertexwahn opened this issue 7 years ago • 2 comments

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)

Vertexwahn avatar Jul 20 '17 13:07 Vertexwahn

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.

paulzmuda avatar Sep 15 '17 01:09 paulzmuda

FOR ME TOO

brainstorminglllp avatar Nov 23 '17 20:11 brainstorminglllp