auth

package
v0.0.0-...-bd23ae7 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const OAuthURI = "https://iam.viessmann-climatesolutions.com/idp/v3"

Variables

This section is empty.

Functions

func NewDemo

func NewDemo(server string, method string, redirectUri string) (oauth2.TokenSource, error)

func NewDemoFromConfig

func NewDemoFromConfig(_ context.Context, other map[string]any) (oauth2.TokenSource, error)

func NewFromConfig

func NewFromConfig(ctx context.Context, typ string, other map[string]any) (oauth2.TokenSource, error)

NewFromConfig creates auth from configuration

func NewOAuthFromConfig

func NewOAuthFromConfig(ctx context.Context, other map[string]any) (oauth2.TokenSource, error)

func NewViessmannFromConfig

func NewViessmannFromConfig(ctx context.Context, other map[string]any) (oauth2.TokenSource, error)

func Register

func Register(typ string, fun func(map[string]any) (oauth2.TokenSource, error))

func WithOauthDeviceFlowOption

func WithOauthDeviceFlowOption() func(o *OAuth)

func WithTokenRetrieverOption

func WithTokenRetrieverOption(tr func(string, *oauth2.Token) error) func(o *OAuth)

func WithTokenStorerOption

func WithTokenStorerOption(ts func(*oauth2.Token) any) func(o *OAuth)

Types

type OAuth

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

func NewOAuth

func NewOAuth(ctx context.Context, name, device string, oc *oauth2.Config, opts ...func(o *OAuth)) (*OAuth, error)

func (*OAuth) Authenticated

func (o *OAuth) Authenticated() bool

Authenticated implements api.AuthProvider.

func (*OAuth) DisplayName

func (o *OAuth) DisplayName() string

DisplayName implements api.AuthProvider.

func (*OAuth) HandleCallback

func (o *OAuth) HandleCallback(params url.Values) error

HandleCallback implements api.AuthProvider.

func (*OAuth) Login

func (o *OAuth) Login(state string) (string, *oauth2.DeviceAuthResponse, error)

Login implements api.AuthProvider.

func (*OAuth) Logout

func (o *OAuth) Logout() error

Logout implements api.AuthProvider.

func (*OAuth) Token

func (o *OAuth) Token() (*oauth2.Token, error)

Token

Jump to

Keyboard shortcuts

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