mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 (#8962)
* Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 * skip failing tests * update mac build image
This commit is contained in:
committed by
Karl Burtram
parent
0eaee18dc4
commit
fefe1454de
@@ -24,7 +24,8 @@ export interface IAuthenticationService {
|
||||
|
||||
readonly onDidChangeSessions: Event<string>;
|
||||
getSessions(providerId: string): Promise<ReadonlyArray<Session> | undefined>;
|
||||
login(providerId: string): Promise<Session>;
|
||||
getDisplayName(providerId: string): string;
|
||||
login(providerId: string, scopes: string[]): Promise<Session>;
|
||||
logout(providerId: string, accountId: string): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -60,6 +61,15 @@ export class AuthenticationService extends Disposable implements IAuthentication
|
||||
this._onDidChangeSessions.fire(id);
|
||||
}
|
||||
|
||||
getDisplayName(id: string): string {
|
||||
const authProvider = this._authenticationProviders.get(id);
|
||||
if (authProvider) {
|
||||
return authProvider.displayName;
|
||||
} else {
|
||||
throw new Error(`No authentication provider '${id}' is currently registered.`);
|
||||
}
|
||||
}
|
||||
|
||||
async getSessions(id: string): Promise<ReadonlyArray<Session> | undefined> {
|
||||
const authProvider = this._authenticationProviders.get(id);
|
||||
if (authProvider) {
|
||||
@@ -69,10 +79,10 @@ export class AuthenticationService extends Disposable implements IAuthentication
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async login(id: string): Promise<Session> {
|
||||
async login(id: string, scopes: string[]): Promise<Session> {
|
||||
const authProvider = this._authenticationProviders.get(id);
|
||||
if (authProvider) {
|
||||
return authProvider.login();
|
||||
return authProvider.login(scopes);
|
||||
} else {
|
||||
throw new Error(`No authentication provider '${id}' is currently registered.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user