Registry / auth / dgrijalva-jwt-go-v3

dgrijalva-jwt-go-v3

JSON →
library3.2.0gogounverified

A Go implementation of JSON Web Tokens (JWT) for creating and verifying tokens.

go get gopkg.in/dgrijalva/jwt-go.v3
INSTALL
IMPORT
SIG · DGRIJALVA-JWT-GO-V
D
dgrijalva-jwt-go-v3
authgov3.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jwt
✓ gopkg.in/dgrijalva/jwt-go.v3

Create and sign a JWT token

package main import ( "fmt" "gopkg.in/dgrijalva/jwt-go.v3" ) func main() { token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ "foo": "bar", }) tokenString, err := token.SignedString([]byte("secret")) if err != nil { panic(err) } fmt.Println(tokenString) }
Debug
Known issues
breakingThis library has known security vulnerabilities (CVE-2020-26160); use github.com/golang-jwt/jwt/v5 instead.
fix
Migrate to github.com/golang-jwt/jwt/v5 which is actively maintained and patched.
affects: >=3.0.0 <4.0.0
Upgrade
Version history
3.2.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
dgrijalva-jwt-go-v3 — go get dgrijalva-jwt-go-v3 · libregistry