googleoauth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package googleoauth implements Google's provider-owned OAuth2 protocol boundary.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidGrant = xerror.New(xerror.KindInvalidInput, "GOOGLE_INVALID_GRANT", "Google OAuth invalid grant")

Functions

This section is empty.

Types

type AuthorizationURLParams

type AuthorizationURLParams struct {
	State          string
	Scopes         []string
	OptionalScopes []string
}

type Client

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

func New

func New(config Config) (*Client, error)

func (*Client) AuthorizationURL

func (c *Client) AuthorizationURL(ctx context.Context, params AuthorizationURLParams) (string, error)

func (*Client) ExchangeCode

func (c *Client) ExchangeCode(ctx context.Context, code string, requiredScopes []string) (TokenSet, error)

func (*Client) Refresh

func (c *Client) Refresh(ctx context.Context, refreshToken string, grantedScopes, requiredScopes []string) (TokenSet, error)

func (*Client) Revoke

func (c *Client) Revoke(ctx context.Context, token string) error

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURI  string
}

type TokenSet

type TokenSet struct {
	AccessToken  string
	RefreshToken string
	ExpiresAt    time.Time
	Scopes       []string
	Subject      string
	Email        string
	Name         string
}

Jump to

Keyboard shortcuts

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