1
2
3
4
5
6
7
8
9
10
11
12
|
tok = jwt.NewWithClaims(jwt.SigningMethodHS256, myClaims{
RegisteredClaims: jwt.RegisteredClaims{
Issuer: "svc",
Subject: "user_id",
Audience: jwt.ClaimStrings{"srv"},
ExpiresAt: jwt.NewNumericDate(time.Now().Add(time.Second * 2)),
NotBefore: jwt.NewNumericDate(time.Now().Add(time.Second)),
IssuedAt: jwt.NewNumericDate(time.Now()),
ID: "id",
},
Foo: "bar",
})
|