Documentation ¶
Index ¶
Constants ¶
View Source
const ( OpenID = "openid" Profile = "profile" Email = "email" Groups = "groups" Internal = "internal" )
View Source
const SignAlgo = "RS256"
SignAlgo const.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type SignClaims ¶
type SignClaims struct { Aud string Exp int64 Iat int64 Issuer string Nonce string Scopes []string }
SignClaims contains claims that are passed to SignExpires func.
type Token ¶
type Token struct {
User *common.User
}
Token struct.
func New ¶
func New(user *common.User) *Token
New constructs new token which is passed for application.
func (*Token) SignExpires ¶
func (t *Token) SignExpires(key common.JWTKey, claim SignClaims) (string, error)
SignExpires makes new jwt token using expiration time and secret.
type UserJWTClaims ¶
type UserJWTClaims struct { *common.User jwt.RegisteredClaims Nonce string `json:"nonce,omitempty"` }
UserJWTClaims contains struct for making and parsing jwt tokens.
func Parse ¶
func Parse(raw string, keys []common.JWTKey, options ...jwt.ParserOption) (*UserJWTClaims, error)
Parse will validate jwt token and return token.
Click to show internal directories.
Click to hide internal directories.