Add preferred_username to the list of msft token claims (#106511)

This commit is contained in:
Oleg Demchenko
2020-09-11 15:38:03 -04:00
committed by GitHub
parent c53524a198
commit 352a390251

View File

@@ -40,6 +40,7 @@ interface ITokenClaims {
tid: string;
email?: string;
unique_name?: string;
preferred_username?: string;
oid?: string;
altsecid?: string;
ipd?: string;
@@ -454,7 +455,7 @@ export class AzureActiveDirectoryService {
scope,
sessionId: existingId || `${claims.tid}/${(claims.oid || (claims.altsecid || '' + claims.ipd || ''))}/${uuid()}`,
account: {
label: claims.email || claims.unique_name || 'user@example.com',
label: claims.email || claims.unique_name || claims.preferred_username || 'user@example.com',
id: `${claims.tid}/${(claims.oid || (claims.altsecid || '' + claims.ipd || ''))}`
}
};