First I am calling getAuthCodeUrl And then handling callback.
Here is my function that handles the callback after user login
async handleCallback(code: string): Promise<{ accessToken: string; refreshToken: string }> {
const tokenRequest = {
scopes,
code,
redirectUri,
accessType: 'offline',
};
try {
const authResult = await this.cca.acquireTokenByCode(tokenRequest);
console.log('authResult: ', authResult);
const accessToken = authResult.accessToken;
const refreshToken = this.getRefreshToken();
return { accessToken, refreshToken };
} catch (error) {
console.error('Error obtaining access token:', error);
throw new Error('Error obtaining access token');
}
}
In result of cca.acquireTokenByCode
I am getting expiresOn and extExpiresOn with different values
expiresOn: 2024-03-19T14:38:04.000Z,
extExpiresOn: 2024-03-19T15:38:04.000Z,
I want to know what these 2 stands for. I read that msal-node
But I didn't find details on result of function call.