mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Use home_oid, over oid, over unique_name, over sub (#11514)
* Prefer the homeOid over oid * Prefer unique_name over sub * Not always defined
This commit is contained in:
@@ -262,7 +262,7 @@ export abstract class AzureAuth implements vscode.Disposable {
|
|||||||
|
|
||||||
const tokenClaims: TokenClaims = this.getTokenClaims(accessTokenString);
|
const tokenClaims: TokenClaims = this.getTokenClaims(accessTokenString);
|
||||||
|
|
||||||
const userKey = tokenClaims.sub ?? tokenClaims.oid;
|
const userKey = tokenClaims.home_oid ?? tokenClaims.oid ?? tokenClaims.unique_name ?? tokenClaims.sub;
|
||||||
|
|
||||||
if (!userKey) {
|
if (!userKey) {
|
||||||
const msg = localize('azure.noUniqueIdentifier', "The user had no unique identifier within AAD");
|
const msg = localize('azure.noUniqueIdentifier', "The user had no unique identifier within AAD");
|
||||||
@@ -666,6 +666,7 @@ export interface TokenClaims { // https://docs.microsoft.com/en-us/azure/active-
|
|||||||
idp: string,
|
idp: string,
|
||||||
nbf: number;
|
nbf: number;
|
||||||
exp: number;
|
exp: number;
|
||||||
|
home_oid?: string;
|
||||||
c_hash: string;
|
c_hash: string;
|
||||||
at_hash: string;
|
at_hash: string;
|
||||||
aio: string;
|
aio: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user