Variables
read onlyonDidChangeSessions:Event<AuthenticationSessionsChangeEvent>
An {@link Event} which fires when the authentication sessions of an authentication provider have been added, removed, or changed.
Methods
getAccounts(providerId:String):Thenable<ReadOnlyArray<AuthenticationSessionAccountInformation>>
Get all accounts that the user is logged in to for the specified provider. Use this paired with {@link getSession} in order to get an authentication session for a specific account.
Currently, there are only two authentication providers that are contributed from built in extensions to the editor that implement GitHub and Microsoft authentication: their providerId's are 'github' and 'microsoft'.
Note: Getting accounts does not imply that your extension has access to that account or its authentication sessions. You can verify access to the account by calling {@link getSession}.
Parameters:
providerId | The id of the provider to use |
---|
Returns:
A thenable that resolves to a readonly array of authentication accounts.
getSession(providerId:String, scopes:ReadOnlyArray<String>, ?options:Null<AuthenticationGetSessionOptions>):Thenable<Null<AuthenticationSession>>
Get an authentication session matching the desired scopes. 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.
Currently, there are only two authentication providers that are contributed from built in extensions to the editor that implement GitHub and Microsoft authentication: their providerId's are 'github' and 'microsoft'. @link AuthenticationGetSessionOptions} to use
Parameters:
providerId | The id of the provider to use |
---|---|
scopes | A list of scopes representing the permissions requested. These are dependent on the authentication provider |
options | The { |
Returns:
A thenable that resolves to an authentication session if available, or undefined if there are no sessions
registerAuthenticationProvider(id:String, label:String, provider:AuthenticationProvider, ?options:Null<AuthenticationProviderOptions>):Disposable
Register an authentication provider.
There can only be one provider per id and an error is being thrown when an id has already been used by another provider. Ids are case-sensitive.
@link Disposable} that unregisters this provider when being disposed.
Parameters:
id | The unique identifier of the provider. |
---|---|
label | The human-readable name of the provider. |
provider | The authentication provider provider. |
options | Additional options for the provider. |
Returns:
A {