Registry / auth / dgrijalva-jwt-go-v4

dgrijalva-jwt-go-v4

JSON →
library4.0.0-preview1gogounverified

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

go get github.com/dgrijalva/jwt-go/v4
INSTALL
IMPORT
SIG · DGRIJALVA-JWT-GO-V
D
dgrijalva-jwt-go-v4
authgov4.0.0-preview1
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
github.com/dgrijalva/jwt-go/v4

Creates a signed JWT token using HMAC-SHA256.

package main import ( "fmt" "github.com/dgrijalva/jwt-go/v4" ) 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 is a preview version (v4.0.0-preview1) and may have breaking changes before stable release.
fix
Use the stable v3.x series or wait for v4 final release.
affects: >=4.0.0-preview1 <4.0.0
Upgrade
Version history
4.0.0-preview1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
Resources
dgrijalva-jwt-go-v4 — go get dgrijalva-jwt-go-v4 · libregistry