Skip to content

Commit 58f0284

Browse files
authored
Merge branch 'dev' into msal-node-documentation-latest
2 parents afb3497 + c715551 commit 58f0284

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

lib/msal-node/src/client/ClientApplication.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ export abstract class ClientApplication {
133133
/**
134134
* Gets the token cache for the application.
135135
*/
136-
getCacheManager(): TokenCache {
137-
this.logger.info("getCacheManager called");
136+
getTokenCache(): TokenCache {
137+
this.logger.info("getTokenCache called");
138138
return this.tokenCache;
139139
}
140140

samples/msal-node-samples/auth-code/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const publicClientConfig = {
4444
    }
4545
};
4646
const pca = new msal.PublicClientApplication(publicClientConfig);
47-
const msalCacheManager = pca.getCacheManager();
47+
const msalTokenCache = pca.getTokenCache();
4848

4949
// Create Express App and Routes
5050
const app = express();
@@ -72,15 +72,15 @@ app.get('/redirect', (req, res) => {
7272
pca.acquireTokenByCode(tokenRequest).then((response) => {
7373
console.log("\nResponse: \n:", response);
7474
res.send(200);
75-
return msalCacheManager.writeToPersistence();
75+
return msalTokenCache.writeToPersistence();
7676
}).catch((error) => {
7777
console.log(error);
7878
res.status(500).send(error);
7979
});
8080
});
8181

82-
msalCacheManager.readFromPersistence().then(() => {
82+
msalTokenCache.readFromPersistence().then(() => {
8383
app.listen(SERVER_PORT, () => console.log(`Msal Node Auth Code Sample app listening on port ${SERVER_PORT}!`))
84-
console.log("Accounts: \n", msalCacheManager.getAllAccounts());
84+
console.log("Accounts: \n", msalTokenCache.getAllAccounts());
8585
});
8686

samples/msal-node-samples/silent-flow/index.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const authCodeUrlParameters = {
6161
};
6262

6363
const pca = new msal.PublicClientApplication(publicClientConfig);
64-
const msalCacheManager = pca.getCacheManager();
64+
const msalTokenCache = pca.getTokenCache();
6565
let accounts;
6666

6767
/**
@@ -73,7 +73,7 @@ const app = express();
7373
app.engine('.hbs', exphbs({extname: '.hbs'}));
7474
app.set('view engine', '.hbs');
7575

76-
/**
76+
/**
7777
* App Routes
7878
*/
7979
app.get('/', (req, res) => {
@@ -102,7 +102,7 @@ app.get('/redirect', (req, res) => {
102102
console.log("\nResponse: \n:", response);
103103
const templateParams = { showLoginButton: false, username: response.account.username, profile: false};
104104
res.render("graph", templateParams);
105-
return msalCacheManager.writeToPersistence();
105+
return msalTokenCache.writeToPersistence();
106106
}).catch((error) => {
107107
console.log(error);
108108
res.status(500).send(error);
@@ -112,7 +112,7 @@ app.get('/redirect', (req, res) => {
112112
// Initiates Acquire Token Silent flow
113113
app.get('/graphCall', (req, res) => {
114114
// get Accounts
115-
accounts = msalCacheManager.getAllAccounts();
115+
accounts = msalTokenCache.getAllAccounts();
116116
console.log("Accounts: ", accounts);
117117

118118
// Build silent request
@@ -130,13 +130,13 @@ app.get('/graphCall', (req, res) => {
130130
// Call graph after successfully acquiring token
131131
graph.callMSGraph(graphConfig.graphMeEndpoint, response.accessToken, (response, endpoint) => {
132132
// Successful silent request
133-
templateParams = {
134-
...templateParams,
133+
templateParams = {
134+
...templateParams,
135135
username,
136136
profile: JSON.stringify(response, null, 4)
137137
};
138-
res.render("graph", templateParams)
139-
return msalCacheManager.writeToPersistence();
138+
res.render("graph", templateParams);
139+
return msalTokenCache.writeToPersistence();
140140
});
141141
})
142142
.catch((error) => {
@@ -146,7 +146,7 @@ app.get('/graphCall', (req, res) => {
146146
});
147147
});
148148

149-
msalCacheManager.readFromPersistence().then(() => {
149+
msalTokenCache.readFromPersistence().then(() => {
150150
app.listen(SERVER_PORT, () => console.log(`Msal Node Auth Code Sample app listening on port ${SERVER_PORT}!`));
151151
});
152152

0 commit comments

Comments
 (0)