Theia API Documentation v1.68.0
    Preparing search index...

    Service for handling GitHub Copilot OAuth Device Flow authentication.

    interface CopilotAuthService {
        onAuthStateChanged: Event<CopilotAuthState>;
        getAccessToken(): Promise<undefined | string>;
        getAuthState(): Promise<CopilotAuthState>;
        initiateDeviceFlow(enterpriseUrl?: string): Promise<DeviceCodeResponse>;
        pollForToken(
            deviceCode: string,
            interval: number,
            enterpriseUrl?: string,
        ): Promise<boolean>;
        setClient(client: undefined | CopilotAuthServiceClient): void;
        signOut(): Promise<void>;
    }

    Implemented by

    Index

    Properties

    onAuthStateChanged: Event<CopilotAuthState>

    Event fired when authentication state changes.

    Methods

    • Polls for the access token after user authorizes.

      Parameters

      • deviceCode: string

        The device code from initiateDeviceFlow

      • interval: number

        Polling interval in seconds

      • OptionalenterpriseUrl: string

        Optional GitHub Enterprise domain

      Returns Promise<boolean>

      true if authentication succeeded, false if expired/denied