JSON Web Tokens for 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.
LICENSE renamed Encode's jwt argument to claims. added license Sep 9, 2011
Makefile encoding jwt's Sep 8, 2011
README.rst
jwt.go updated for go 1.0.1 May 22, 2012
jwt_test.go switched errors to os.NewError Oct 28, 2011

README.rst

GoJWT

Author: Michael "Z" Goddard
Contact: mzgoddard@gmail.com
Date: Friday, September 9th, 2011
License:MIT

JSON Web Tokens for Go.

Interface inspired by pyjwt.

Install

goinstall github.com/mzgoddard/gojwt

Example

func queryJwt(w http.ResponseWriter, r *http.Request) {
  fmt.Fprint(w, string(jwt.Encode(
    map[string]interface{}{
      "iss": 12345,
      "request": map[string]interface{}{
        "name": "pie",
        "description": "triangular shaped piece of baked good",
        "delicious": true,
      },
    },
    []byte("super top secret"),
    "HS256",
  )))
}