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

deviceflow

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(tg *TokenGetter)

func WithMessagePrinter

func WithMessagePrinter(fn func(string)) Option

func WithSleeper

func WithSleeper(fn func(time.Duration)) Option

type TokenGetter

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

TokenGetter fetches an OIDC Identity token using the Device Code Grant flow as specified in RFC8628

func NewTokenGetter

func NewTokenGetter(issuer string, opts ...Option) *TokenGetter

NewTokenGetter creates a new TokenGetter that retrieves an OIDC Identity Token using a Device Code Grant

func (*TokenGetter) CodeURL

func (d *TokenGetter) CodeURL() (string, error)

CodeURL fetches the device authorization endpoint URL from the provider's well-known configuration endpoint

func (*TokenGetter) GetIDToken

func (d *TokenGetter) GetIDToken(p *oidc.Provider, cfg oauth2.Config) (*oauthflow.OIDCIDToken, error)

GetIDToken gets an OIDC ID Token from the specified provider using the device code grant flow

Jump to

Keyboard shortcuts

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