Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWK ¶
type JWK struct {
Kid string `json:"kid"`
Kty string `json:"kty"`
Alg string `json:"alg"`
Use string `json:"use"`
// RSA fields
N string `json:"n,omitempty"`
E string `json:"e,omitempty"`
// EC / OKP fields
Crv string `json:"crv,omitempty"`
X string `json:"x,omitempty"`
Y string `json:"y,omitempty"`
X5c []string `json:"x5c,omitempty"`
}
type JWKSResponse ¶
type JWKSResponse struct {
Keys []JWK `json:"keys"`
}
type TgClaims ¶
type TgClaims struct {
jwt.RegisteredClaims
Id int64 `json:"-"`
Login string `json:"-"`
Email string `json:"email"`
EmailVerified bool `json:"email_verified"`
Name string `json:"name"`
GivenName string `json:"given_name"`
FamilyName string `json:"family_name"`
Picture string `json:"picture"`
Locale string `json:"locale"`
}
func (*TgClaims) UnmarshalJSON ¶
UnmarshalJSON is defined explicitly so the "id" claim can be decoded via telegramID while every other field keeps the default struct-tag-driven unmarshaling.
type TokenParser ¶
type TokenParser struct {
// contains filtered or unexported fields
}
func NewTokenParser ¶
func NewTokenParser(jwksURL, issuer, audience string) TokenParser
func (*TokenParser) ParseAndVerifyIdToken ¶
func (tp *TokenParser) ParseAndVerifyIdToken(idToken string) (TgClaims, error)
Click to show internal directories.
Click to hide internal directories.