oauthgoogle

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package oauthgoogle defines a minimal Google OAuth provider API.

The current provider implementation is a placeholder and reports ErrNotAvailable.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAvailable = errors.New("oauth_google_not_available")

ErrNotAvailable is returned while the provider implementation is disabled.

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider starts and completes Google OAuth flows.

func Current

func Current() *Provider

Current returns the process-wide Google OAuth provider.

func (*Provider) Available

func (p *Provider) Available() bool

Available reports whether the Google OAuth provider is configured.

func (*Provider) Callback

func (p *Provider) Callback(ctx context.Context, code, verifier string) (*UserInfo, error)

Callback exchanges an OAuth authorization code for user information.

func (*Provider) Start

func (p *Provider) Start(w http.ResponseWriter, state, verifier string)

Start writes the OAuth redirect response.

type UserInfo

type UserInfo struct {
	Provider      string
	Subject       string
	Email         string
	VerifiedEmail bool
}

UserInfo describes the authenticated Google account.

Jump to

Keyboard shortcuts

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