-
Notifications
You must be signed in to change notification settings - Fork 0
/
scopeConfig.js
58 lines (52 loc) · 1.54 KB
/
scopeConfig.js
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
// For a full list of msal.js configuration parameters,
// visit https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md
export const msalConfig = {
auth: {
clientId: "<Application (client) ID>",
authority: "https://login.microsoftonline.com/<Directory (tenant) ID>",
// redirectUri: 'http://localhost:3000/',
},
cache: {
cacheLocation: "sessionStorage", // This configures where your cache will be stored
storeAuthStateInCookie: true, // Set this to "true" if you are having issues on IE11 or Edge
}
};
const GRAPH_SCOPES = {
OPENID: "openid",
PROFILE: "profile",
USER_READ: "User.Read",
APP: "api://<Directory (tenant) ID>/<api_name>",
};
const GRAPH_SCOPES_BI = {
PBI: "https://analysis.windows.net/powerbi/api/Report.Read.All"
};
// Set respective Scopes per type
export const GRAPH_REQUESTS = {
LOGIN: {
scopes: [
GRAPH_SCOPES.USER_READ,
GRAPH_SCOPES.OPENID,
GRAPH_SCOPES.PROFILE
]
},
GROUP: {
scopes: [GRAPH_SCOPES.USER_READ]
},
BI: {
scopes: [
GRAPH_SCOPES_BI.PBI
]
},
};
// Authenticate agains Azure AD - oAuth
export const loginScope = {
scopes: GRAPH_REQUESTS.LOGIN.scopes,
}
// Read object in Graph for User Photo
export const photoScope = {
scopes: GRAPH_REQUESTS.GROUP.scopes,
};
// Integrate with another Azure Service like Power BI
export const loginScopeBI = {
scopes: GRAPH_REQUESTS.BI.scopes
}