Private ReadonlyextensionExtension identifier used for URI handler registration
Protected ReadonlyloggerLogger instance for this service
Protected ReadonlynameService name for logging
PrivatependingMap of pending OAuth flows indexed by state parameter. State provides CSRF protection and flow tracking.
Private OptionaluriDisposable for URI handler
Private Static ReadonlyFLOW_Timeout duration for OAuth flows (5 minutes)
Gets the current service state.
ProtectedassertDisposes the service and cleans up resources. Ensures disposal only happens once.
Get count of pending OAuth flows (for testing/debugging).
PrivatehandleHandle OAuth callback from URI handler.
This method:
Callback URI from OAuth provider
Initializes the service. Ensures initialization only happens once and tracks state.
ProtectedonClean up OAuth flow manager.
ProtectedonInitialize OAuth flow manager and register URI handler.
Start an OAuth authentication flow.
This method:
OAuth provider (github or linkedin)
Promise that resolves with authentication token
PrivatevalidateValidate OAuth state parameter and consume the pending flow.
This method provides CSRF protection by:
State parameter from OAuth callback
Pending flow if valid, null otherwise
Manages OAuth authentication flows adapted for VS Code.
Unlike browser-based OAuth flows, VS Code requires:
Example