NewWithClaims creates a new [Token] with the specified signing method and claims. Additional options can be specified, but are currently unused.
(method SigningMethod, claims Claims, opts ...TokenOption)
| 45 | // NewWithClaims creates a new [Token] with the specified signing method and |
| 46 | // claims. Additional options can be specified, but are currently unused. |
| 47 | func NewWithClaims(method SigningMethod, claims Claims, opts ...TokenOption) *Token { |
| 48 | return &Token{ |
| 49 | Header: map[string]any{ |
| 50 | "typ": "JWT", |
| 51 | "alg": method.Alg(), |
| 52 | }, |
| 53 | Claims: claims, |
| 54 | Method: method, |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | // SignedString creates and returns a complete, signed JWT. The token is signed |
| 59 | // using the SigningMethod specified in the token. Please refer to |