Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
func GenerateAccessToken ¶
func GenerateAccessToken( userId int64, thingId int64, durationInMinutes time.Duration, ) (string, error)
Function returns token string which was generated. Set `durationInMinutes` to zero if you want to create an access token without expiration limit.
func GetAccessTokenSecretKey ¶
func GetAccessTokenSecretKey() []byte
Function returns the `secret key` used by our web service for signing our JWT standard claims.
func HashPassword ¶
Types ¶
type AccessTokenClaims ¶
type AccessTokenClaims struct { UserId int64 `json:"user_id"` ThingId int64 `json:"ThingId"` jwt.StandardClaims }
The user claim embedded with the JWT standard claim.
func VerifyAccessTokenString ¶
func VerifyAccessTokenString(tokenString string) (*AccessTokenClaims, error)
Function returns the verified claims if the JWT claim was verified, else return the error.
Click to show internal directories.
Click to hide internal directories.