API Reference
Class
GitHubDeviceFlowClient
Reusable GitHub device authorization and token renewal over HTTP. Never launches a process or browser.
Inheritance
- Object
- GitHubDeviceFlowClient
Constructors
GitHubDeviceFlowClient 2 overloads
public GitHubDeviceFlowClient(String clientId, String authBaseUrl = "https://github.com/", HttpClient httpClient = null) #Creates an authorization client for a registered GitHub app with device flow enabled.
Parameters
- clientId System.String
- The host product's registered public client ID.
- authBaseUrl System.String = "https://github.com/"
- GitHub login root, or an explicitly trusted enterprise login root.
- httpClient System.Net.Http.HttpClient = null
- Optional host HTTP client. The caller retains ownership.
public GitHubDeviceFlowClient(String clientId, String authBaseUrl, HttpClient httpClient, TimeSpan requestTimeout) #Creates an authorization client with a timeout for each HTTP operation, independently of the user's approval window.
Parameters
- clientId System.String
- The host product's registered public client ID.
- authBaseUrl System.String
- GitHub login root, or an explicitly trusted enterprise login root.
- httpClient System.Net.Http.HttpClient
- Optional host HTTP client. The caller retains ownership.
- requestTimeout System.TimeSpan
- Maximum duration of an HTTP request and its response body.
Methods
public async Task<AuthBundle> CompleteAsync(GitHubDeviceAuthorization authorization, String provider = "github", CancellationToken cancellationToken = null) #Returns:
Task<AuthBundle>Waits for the user to approve a pending sign-in, honoring server polling intervals and cancellation.
Parameters
- authorization IntelligenceX.Authentication.GitHub.GitHubDeviceAuthorization
- provider System.String = "github"
- cancellationToken System.Threading.CancellationToken = null
public async Task<AuthBundle> RefreshAsync(AuthBundle bundle, String clientSecret = null, CancellationToken cancellationToken = null) #Returns:
Task<AuthBundle>Renews an expiring GitHub credential. Some registered app types require the host to supply its client secret.
Parameters
- bundle IntelligenceX.OpenAI.Auth.AuthBundle
- clientSecret System.String = null
- cancellationToken System.Threading.CancellationToken = null
public async Task<GitHubDeviceAuthorization> RequestCodeAsync(String scopes = null, CancellationToken cancellationToken = null) #Returns:
Task<GitHubDeviceAuthorization>Requests a sign-in code. This does not authorize the application.
Parameters
- scopes System.String = null
- cancellationToken System.Threading.CancellationToken = null