Documentation ¶
Index ¶
- Variables
- func CreateUserTokenString(u structs.User, customClaims structs.CustomClaims, ptokens structs.PTokens) string
- func PTokenToUsername(ptoken *jwt.Token) (string, error)
- func ParseTokenString(tokenString string) (*jwt.Token, error)
- func SiteInClaims(site string, claims *Oauth2Claims) bool
- func SiteInToken(site string, token *jwt.Token) bool
- func TokenIsValid(token *jwt.Token, err error) bool
- type Oauth2Claims
Constants ¶
This section is empty.
Variables ¶
View Source
var CustomClaims map[string]interface{}
CustomClaims implementation
View Source
var Sites []string
Sites added to Oauth2Claims
View Source
var StandardClaims jwt.StandardClaims
StandardClaims jwt.StandardClaims implementation
Functions ¶
func CreateUserTokenString ¶
func CreateUserTokenString(u structs.User, customClaims structs.CustomClaims, ptokens structs.PTokens) string
CreateUserTokenString converts user to signed jwt
func PTokenToUsername ¶
PTokenToUsername returns the Username in the validated ptoken
func ParseTokenString ¶
ParseTokenString converts signed token to jwt struct
func SiteInClaims ¶
func SiteInClaims(site string, claims *Oauth2Claims) bool
SiteInClaims does the claim contain the value?
func SiteInToken ¶
SiteInToken searches does the token contain the site?
Types ¶
type Oauth2Claims ¶
type Oauth2Claims struct { Username string `json:"username"` Sites []string `json:"sites"` // tempting to make this a map but the array is fewer characters in the jwt CustomClaims map[string]interface{} PAccessToken string PIdToken string jwt.StandardClaims }
Oauth2Claims jwt Claims specific to oauth2
func PTokenClaims ¶
func PTokenClaims(ptoken *jwt.Token) (Oauth2Claims, error)
PTokenClaims get all the claims TODO HERE there's something wrong with claims parsing, probably related to Oauth2Claims not being a pointer
Click to show internal directories.
Click to hide internal directories.