Documentation
¶
Overview ¶
Package auth provides MSAL-based authentication for Microsoft Graph.
Index ¶
- func StatusJSON(ctx context.Context, client *Client) ([]byte, error)
- type Client
- func (c *Client) AcquireToken(ctx context.Context, scopes []string, forceDeviceCode bool) (string, error)
- func (c *Client) AcquireTokenDeviceCode(ctx context.Context, scopes []string) (string, error)
- func (c *Client) AcquireTokenInteractive(ctx context.Context, scopes []string) (string, error)
- func (c *Client) AcquireTokenSilent(ctx context.Context, scopes []string) (string, error)
- func (c *Client) AcquireTokenWithExtraScopes(ctx context.Context, existingScopes, extraScopes []string, ...) (string, error)
- func (c *Client) GetAccounts(ctx context.Context) ([]public.Account, error)
- func (c *Client) SignOut() error
- func (c *Client) Status(ctx context.Context) (map[string]interface{}, error)
- type SessionData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the MSAL public client application with session management.
func (*Client) AcquireToken ¶
func (c *Client) AcquireToken(ctx context.Context, scopes []string, forceDeviceCode bool) (string, error)
AcquireToken attempts silent auth first, then falls back to interactive/device code.
func (*Client) AcquireTokenDeviceCode ¶
AcquireTokenDeviceCode uses the device code flow for authentication.
func (*Client) AcquireTokenInteractive ¶
AcquireTokenInteractive opens the system browser for authentication.
func (*Client) AcquireTokenSilent ¶
AcquireTokenSilent attempts to get a token from the cache without user interaction.
func (*Client) AcquireTokenWithExtraScopes ¶
func (c *Client) AcquireTokenWithExtraScopes(ctx context.Context, existingScopes, extraScopes []string, forceDeviceCode bool) (string, error)
AcquireTokenWithExtraScopes re-authenticates with additional scopes for incremental consent.
func (*Client) GetAccounts ¶
GetAccounts returns the accounts currently in the cache.
Click to show internal directories.
Click to hide internal directories.