Skip to content
JSON Web Tokens for Go
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github add automatic releases (#29) Feb 5, 2020
LICENSE add MIT license Jul 20, 2019
README.md
algo.go remove unused panics Nov 1, 2019
algo_eddsa.go add EdDSA Jan 4, 2020
algo_eddsa_test.go add EdDSA Jan 4, 2020
algo_es.go add initial ES Jan 4, 2020
algo_es_test.go add ES tests Jan 4, 2020
algo_hs.go fixes :) Jan 4, 2020
algo_hs_test.go fixes :) Jan 4, 2020
algo_none.go
algo_none_test.go fixes :) Jan 4, 2020
algo_ps.go add RSA PSS (PS) Jan 4, 2020
algo_ps_test.go add RSA PSS (PS) Jan 4, 2020
algo_rs.go fixes :) Jan 4, 2020
algo_rs_test.go
algo_test.go fixes :) Jan 4, 2020
audience.go update documentation Nov 5, 2019
audience_test.go
build.go improve builder Nov 5, 2019
build_test.go
claims.go simplift claims + tests Nov 8, 2019
claims_test.go simplift claims + tests Nov 8, 2019
errors.go fixes :) Jan 4, 2020
example_build_test.go update examples Jan 4, 2020
example_parse_test.go add simple parse example Oct 5, 2019
example_validate_test.go update examples Jan 4, 2020
fuzz.go Add Fuzz test for jwt.Parse (#25) Oct 6, 2019
go.mod Bump Go version to 1.13 (#28) Feb 5, 2020
jwt.go reorder Signer.Verify params Nov 7, 2019
jwt_test.go fixes :) Jan 4, 2020
parse.go
parse_test.go fixed an error in ParseAndVerify (#26) Jan 27, 2020
ts.go update documentation Nov 5, 2019
ts_test.go
validator.go add time validator checks Jan 4, 2020
validator_test.go add time validator checks Jan 4, 2020

README.md

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

signer := jwt.NewHS256([]byte(`secret`))
builder := jwt.NewTokenBuilder(signer)

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

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

Documentation

See these docs.

License

MIT License.

You can’t perform that action at this time.