oauth

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JWTDecodeUnsafe

func JWTDecodeUnsafe(token string, target jwt.Claims) error

JWTDecodeUnsafe decodes the JWT without validating it and without verifying the sign.

func NewGoogleOAuthProvider

func NewGoogleOAuthProvider() core.OAuthProvider

NewGoogleOAuthProvider is the constructor for GoogleOAuthProvider.

Types

type GoogleClaims

type GoogleClaims struct {
	Email       string `json:"email"`
	GivenName   string `json:"given_name"`
	FamilyName  string `json:"family_name"`
	PictureLink string `json:"picture"`
}

GoogleClaims is the models of the claims present in a Google ID token.

func (*GoogleClaims) Valid

func (g *GoogleClaims) Valid() error

type GoogleOAuthProvider

type GoogleOAuthProvider struct {
	// contains filtered or unexported fields
}

GoogleOAuthProvider implements core.OAuthProvider for google.

func (*GoogleOAuthProvider) Code2Token

func (g *GoogleOAuthProvider) Code2Token(ctx context.Context, code string) (string, error)

func (*GoogleOAuthProvider) GetRedirectURL

func (g *GoogleOAuthProvider) GetRedirectURL(ctx context.Context) string

func (*GoogleOAuthProvider) Name

func (g *GoogleOAuthProvider) Name() string

func (*GoogleOAuthProvider) Token2UserInfo

func (g *GoogleOAuthProvider) Token2UserInfo(ctx context.Context, token string) (*core.UserDoc, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL