mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Made id_token optional in ITokenResponse
According to: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#successful-response-1
This commit is contained in:
parent
c98463a24c
commit
f19ccd13c2
|
@ -68,7 +68,7 @@ export interface ITokenResponse {
|
|||
refresh_token: string;
|
||||
scope: string;
|
||||
token_type: string;
|
||||
id_token: string;
|
||||
id_token?: string;
|
||||
}
|
||||
|
||||
function parseQuery(uri: vscode.Uri) {
|
||||
|
@ -454,9 +454,13 @@ export class AzureActiveDirectoryService {
|
|||
|
||||
try {
|
||||
claims = this.getTokenClaims(json.access_token);
|
||||
} catch {
|
||||
} catch (e) {
|
||||
if (json.id_token) {
|
||||
Logger.info('Failed to fetch token claims from access_token. Attempting to parse id_token instead');
|
||||
claims = this.getTokenClaims(json.id_token);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue