Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jwt

Build Status GoDoc Go Report Card Coverage

JSON Web Tokens for Go

Features

  • Simple API.
  • Optimized for speed.
  • Dependency-free.

Install

Go version 1.13

go get github.com/cristalhq/jwt

Example

key := []byte(`secret`)
signer, errSigner := jwt.NewHS256(key)
builder := jwt.NewBuilder(signer)

claims := &jwt.StandardClaims{
    Audience: []string{"admin"},
    ID:       "random-unique-string",
}
token, errBuild := builder.Build(claims)

raw := token.Raw() // JWT signed token

errVerify := signer.Verify(token.Payload(), token.Signature())

Also see examples: build, parse.

Documentation

See these docs.

License

MIT License.

About

JSON Web Tokens for Go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages