/gojwt

JSON Web Tokens for Go

Primary LanguageGoMIT LicenseMIT

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",
  )))
}