IntelligenceX

API Reference

Class

GitHubDeviceFlowClient

Namespace IntelligenceX.Authentication.GitHub
Assembly IntelligenceX
Implements
IDisposable
Modifiers sealed

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 requiredposition: 0
The host product's registered public client ID.
authBaseUrl System.String = "https://github.com/" optionalposition: 1
GitHub login root, or an explicitly trusted enterprise login root.
httpClient System.Net.Http.HttpClient = null optionalposition: 2
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 requiredposition: 0
The host product's registered public client ID.
authBaseUrl System.String requiredposition: 1
GitHub login root, or an explicitly trusted enterprise login root.
httpClient System.Net.Http.HttpClient requiredposition: 2
Optional host HTTP client. The caller retains ownership.
requestTimeout System.TimeSpan requiredposition: 3
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 requiredposition: 0
provider System.String = "github" optionalposition: 1
cancellationToken System.Threading.CancellationToken = null optionalposition: 2
public virtual Void Dispose() #
Returns: Void

Releases only HTTP resources created by this instance.

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 requiredposition: 0
clientSecret System.String = null optionalposition: 1
cancellationToken System.Threading.CancellationToken = null optionalposition: 2
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 optionalposition: 0
cancellationToken System.Threading.CancellationToken = null optionalposition: 1