MCPcopy Create free account
hub / github.com/brimdata/super / GetDeviceCode

Method GetDeviceCode

api/client/auth0/auth0.go:70–83  ·  view source on GitHub ↗
(ctx context.Context, scope string)

Source from the content-addressed store, hash-verified

68}
69
70func (c *Client) GetDeviceCode(ctx context.Context, scope string) (DeviceCodeResponse, error) {
71 type deviceCodeRequest struct {
72 Audience string `json:"audience"`
73 ClientID string `json:"client_id"`
74 Scope string `json:"scope"`
75 }
76 var res DeviceCodeResponse
77 err := c.post(ctx, "/oauth/device/code", deviceCodeRequest{
78 Audience: c.config.Audience,
79 ClientID: c.config.ClientID,
80 Scope: scope,
81 }, &res)
82 return res, err
83}
84
85func (c *Client) PollDeviceCodeTokens(ctx context.Context, dcr DeviceCodeResponse) (Tokens, error) {
86 delay := time.Duration(dcr.Interval) * time.Second

Callers 1

RunMethod · 0.95

Calls 1

postMethod · 0.95

Tested by

no test coverage detected