/
types.ts
65 lines (61 loc) · 1.37 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
/**
* The shape we use return the token (and the expiration date).
* @internal
*/
export interface MsalToken {
accessToken?: string;
expiresOn: Date | null;
}
/**
* Internal representation of MSAL's Account information.
* Helps us to disambiguate the MSAL classes accross environments.
* @internal
*/
export interface MsalAccountInfo {
homeAccountId: string;
environment?: string;
tenantId: string;
username: string;
localAccountId: string;
name?: string;
// Leaving idTokenClaims as object since that's how MSAL has this assigned.
/* eslint-disable-next-line @typescript-eslint/ban-types */
idTokenClaims?: object;
}
/**
* Represents the common properties of any of the MSAL responses.
* @internal
*/
export interface MsalResult {
authority?: string;
account: MsalAccountInfo | null;
accessToken: string;
expiresOn: Date | null;
}
/**
* The record to use to find the cached tokens in the cache.
*/
export interface AuthenticationRecord {
/**
* The associated authority, if used.
*/
authority: string;
/**
* The home account Id.
*/
homeAccountId: string;
/**
* The associated client ID.
*/
clientId: string;
/**
* The associated tenant ID.
*/
tenantId: string;
/**
* The username of the logged in account.
*/
username: string;
}