Help us shape the future of Go! Take the 2026 Go Developer Survey

oauth

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder(provider types.ProviderType, opts ...ProviderOption) providers.Builder

Builder returns a providers.Builder that constructs OAuth providers for the given provider type

Types

type Provider

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

Provider implements the types.Provider interface using Zitadel's relying party helpers

func New

func New(_ context.Context, spec config.ProviderSpec, options ...ProviderOption) (*Provider, error)

New constructs a Provider from the supplied spec

func (*Provider) BeginAuth

func (p *Provider) BeginAuth(_ context.Context, input types.AuthContext) (types.AuthSession, error)

BeginAuth starts an OAuth authorization flow

func (*Provider) Capabilities

func (p *Provider) Capabilities() types.ProviderCapabilities

Capabilities describes supported behaviours

func (*Provider) Mint

Mint refreshes an access token using the stored credential payload

func (*Provider) Operations

func (p *Provider) Operations() []types.OperationDescriptor

Operations returns the provider-published operations if configured.

func (*Provider) Type

func (p *Provider) Type() types.ProviderType

Type returns the provider identifier

type ProviderOption

type ProviderOption func(*Provider)

ProviderOption customizes OAuth provider construction.

func WithOperations

func WithOperations(descriptors []types.OperationDescriptor) ProviderOption

WithOperations configures provider-managed operations.

type Session

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

Session implements types.AuthSession for OAuth flows

func (*Session) AuthURL

func (s *Session) AuthURL() string

AuthURL returns the URL the client should redirect to

func (*Session) Finish

func (s *Session) Finish(ctx context.Context, code string) (types.CredentialPayload, error)

Finish exchanges the authorization code for a credential payload

func (*Session) ProviderType

func (s *Session) ProviderType() types.ProviderType

ProviderType returns the provider identifier

func (*Session) State

func (s *Session) State() string

State returns the authorization state value

Jump to

Keyboard shortcuts

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