API Reference
CopilotNativeAuthentication
Owns Copilot credentials, optional GitHub device sign-in, and renewal independently of any product or CLI.
Inheritance
- Object
- CopilotNativeAuthentication
Constructors
public CopilotNativeAuthentication(CopilotNativeOptions options, HttpClient? httpClient = null) #Creates a credential owner. A supplied HTTP client takes precedence over the options handler and remains owned by the caller.
Parameters
- options IntelligenceX.Copilot.Native.CopilotNativeOptions
- httpClient System.Net.Http.HttpClient? = null
Methods
public Void Dispose() #VoidReleases HTTP resources created by this instance. Call after outstanding operations finish.
public async Task<String> GetAccessTokenAsync(CancellationToken cancellationToken = default) #Task<String>Returns the current credential, renewing a stored expiring token when configured. Never invokes a CLI.
Parameters
- cancellationToken System.Threading.CancellationToken = default
public async Task<AccountInfo> GetAccountAsync(CancellationToken cancellationToken = default) #Task<AccountInfo>Verifies the identity associated with the selected credential.
Parameters
- cancellationToken System.Threading.CancellationToken = default
public async Task<AccountInfo> LoginAsync(Action<GitHubDeviceAuthorization> onCode, CancellationToken cancellationToken = default) #Task<AccountInfo>Runs device sign-in, verifies GitHub identity, and saves the credential only when an auth store was explicitly supplied.
Parameters
- onCode System.Action<IntelligenceX.Authentication.GitHub.GitHubDeviceAuthorization>
- cancellationToken System.Threading.CancellationToken = default
public async Task LogoutAsync(CancellationToken cancellationToken = default) #TaskRemoves this account's stored credential and prevents reuse in this instance. Does not revoke GitHub grants.
Parameters
- cancellationToken System.Threading.CancellationToken = default
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Fields
public const String Provider #Provider key used in the shared IntelligenceX authentication store.
copilot