Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceCodeClient ¶
type DeviceCodeClient struct {
Tenant string
ClientID string
Store *store.TokenStore
OnDeviceCode func(userCode, verificationURI string)
// contains filtered or unexported fields
}
DeviceCodeClient authenticates with Microsoft identity via the device code flow and injects Bearer tokens into every outgoing HTTP request.
func NewDeviceCodeClient ¶
func NewDeviceCodeClient(tenant, clientID string, st *store.TokenStore) *DeviceCodeClient
func (*DeviceCodeClient) AuthorizedClient ¶
func (c *DeviceCodeClient) AuthorizedClient(ctx context.Context) *http.Client
AuthorizedClient returns an *http.Client whose every request carries a valid Bearer token.
func (*DeviceCodeClient) EnsureLogin ¶
func (c *DeviceCodeClient) EnsureLogin(ctx context.Context) error
EnsureLogin verifies that a valid token is available, starting an interactive device-code flow if not.
Click to show internal directories.
Click to hide internal directories.