Versions in this module Expand all Collapse all v0 v0.9.0 Aug 12, 2026 Changes in this version + var ErrDeviceCodeDenied = errors.New("safeguard/auth: device code authorization was denied") + var ErrDeviceCodeExpired = errors.New("safeguard/auth: device code expired before authorization completed") + var ErrLoginResponseFailed = errors.New("safeguard/auth: login response was not successful") + var ErrMissingToken = errors.New("safeguard/auth: authentication response contained no token") + var ErrSecondaryFactorFailed = errors.New("safeguard/auth: multi-factor authentication failed") + var ErrSecondaryFactorRequired = errors.New(...) + func AcquireBrowserLoopbackURL(ctx context.Context, cfg Config, httpClient HTTPClient, ...) (string, error) + func BrowserAuthorizeURL(cfg Config, challenge string, port int, username string) string + func ExchangeRSTSToken(ctx context.Context, cfg Config, rstsToken []byte) ([]byte, error) + func LoginCertificate(ctx context.Context, cfg Config, provider string) ([]byte, error) + func LoginPKCE(ctx context.Context, cfg Config, provider, username string, password []byte, ...) ([]byte, error) + func LoginPassword(ctx context.Context, cfg Config, provider, username string, password []byte) ([]byte, error) + func PollDeviceCode(ctx context.Context, cfg Config, httpClient HTTPClient, deviceCode string, ...) ([]byte, error) + func RedeemBrowserCode(ctx context.Context, cfg Config, httpClient HTTPClient, code, verifier string) ([]byte, error) + func ResolveProviderScope(ctx context.Context, cfg Config, provider, defaultProviderID string) (string, error) + type Config struct + APIVersion string + CertHTTPClient HTTPClient + HTTPClient HTTPClient + Host string + type DeviceCodeChallenge struct + DeviceCode string + ExpiresIn time.Duration + Interval time.Duration + UserCode string + VerificationURI string + VerificationURIComplete string + func StartDeviceCode(ctx context.Context, cfg Config, httpClient HTTPClient) (DeviceCodeChallenge, error) + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type PKCEPair struct + Challenge string + Verifier string + func NewPKCEPair() (PKCEPair, error) + type RequestError struct + Err error + Op string + StatusCode int + func (e *RequestError) Body() []byte + func (e *RequestError) Error() string + func (e *RequestError) Unwrap() error + type SecondaryFactorProvider func(ctx context.Context, prompt string) ([]byte, error)