getSessionAsync

fun getSessionAsync(providerId: String, scopeListOrRequest: ReadonlyArray<JsString>, options: JsAny): PromiseLike<AuthenticationSession>(source)

Get an authentication session matching the desired scopes or satisfying the WWW-Authenticate request. Rejects if a provider with providerId is not registered, or if the user does not consent to sharing authentication information with the extension. If there are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use.

Built-in auth providers include:

  • 'github' - For GitHub.com

  • 'microsoft' For both personal & organizational Microsoft accounts

  • (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server

  • (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds

Parameters

providerId

The id of the provider to use

scopeListOrRequest

A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.




fun getSessionAsync(providerId: String, scopeListOrRequest: ReadonlyArray<JsString>, options: AuthenticationGetSessionOptions = definedExternally): PromiseLike<AuthenticationSession?>(source)

Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not registered, or if the user does not consent to sharing authentication information with the extension. If there are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use.

Built-in auth providers include:

  • 'github' - For GitHub.com

  • 'microsoft' For both personal & organizational Microsoft accounts

  • (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server

  • (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds

Parameters

providerId

The id of the provider to use

scopeListOrRequest

A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider.