Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateGoogleKeys ¶
func UpdateGoogleKeys()
TODO: fetch keys/certs from: https://www.googleapis.com/oauth2/v3/certs according to docs they are updated regulary (see https://developers.google.com/identity/gsi/web/guides/verify-google-id-token)
func ValidateToken ¶
aud is the client_id received from Google when registered the app based on https://developers.google.com/identity/gsi/web/guides/verify-google-id-token
Types ¶
type GoogleOIDClaims ¶
type GoogleOIDClaims struct { Email string `json:"email"` EmailVerified bool `json:"email_verified"` Name string `json:"name"` Picture string `json:"picture"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` Locale string `json:"locale"` jwt.RegisteredClaims }
func ParseToken ¶
func ParseToken(tokenStr string) (*jwt.Token, *GoogleOIDClaims, error)
func ValidateGoogleJWT ¶
func ValidateGoogleJWT(c *gin.Context, clientId string) (*GoogleOIDClaims, error)
Click to show internal directories.
Click to hide internal directories.