oauth

package
v1.11.5 Latest Latest
Warning

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

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

Documentation

Overview

Package oauth implements the oauth integration provider.

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 {
	// BaseProvider holds shared provider metadata
	providers.BaseProvider
	// contains filtered or unexported fields
}

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

func New

func New(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) Mint

Mint refreshes an access token using the stored credential payload

type ProviderOption

type ProviderOption func(*Provider)

ProviderOption customizes OAuth provider construction.

func WithClientDescriptors added in v1.9.3

func WithClientDescriptors(descriptors []types.ClientDescriptor) ProviderOption

WithClientDescriptors registers client descriptors for pooling.

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