token

package
v0.0.0-...-84f9aa2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(dataClaim *jwt.MapClaims) (string, error)

Create signs a token with given data and returns a token string

func Parse

func Parse(token string) (jwt.MapClaims, error)

Parse prepends the algorithm string to a shortened token, if needed. If the token is not shortened, just parse and verify it, and return the parsed data.

Example parsing of returned claims: td.IAT = int64(claims["iat"].(float64)) claimsData := claims["data"].(map[string]interface{}) td.ID = int64(claimsData["id"].(float64)) td.Name = claimsData["name"].(string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL