go-chi / jwtauth

JWT authentication middleware for Go HTTP services
MIT License
550 stars 91 forks source link

Error with using Claims type as Map #7

Closed jdek closed 7 years ago

jdek commented 8 years ago

Running the example gives the following error:

# github.com/goware/jwtauth
../github.com/goware/jwtauth/jwtauth.go:151: cannot use claims (type Claims) as type jwt.Claims in assignment:
        Claims does not implement jwt.Claims (missing Valid method)
../github.com/goware/jwtauth/jwtauth.go:173: invalid operation: t.Claims["exp"] (type jwt.Claims does not support indexing)
../github.com/goware/jwtauth/jwtauth.go:175: use of .(type) outside type switch
pkieltyka commented 8 years ago

thanks for the heads up. Looks to be that https://github.com/dgrijalva/jwt-go has released v3.0 with a few breaking changes.

pkieltyka commented 8 years ago

I suggest to vendor https://github.com/dgrijalva/jwt-go/tree/v2.7.0 as jwt-go v3.0 is very new, and are a few outstanding issues before I can upgrade this package

JesseObrien commented 7 years ago

Any movement on this?

pkieltyka commented 7 years ago

@JesseObrien not at this time, but PRs are welcome. jwt-go 2.7.0 works just fine, is there a particular reason you need 3.0?

pkieltyka commented 7 years ago

done, jwtauth latest version supports jwt-go v3