Hello @Jagadish , in some instancess the ID token may not be refreshed during a call to acquireSilentToken. In order to ensure it is set the forceRefresh
param to true
.
const response = await instance
.acquireTokenSilent({
scopes: ["openid", "offline_access", "profile"],
account,
forceRefresh: true
})
.catch(async (error) => {
if (error instanceof InteractionRequiredAuthError) {
// fallback to interaction when silent call fails
return await instance.acquireTokenRedirect({
...loginRequest,
account,
});
}
});
Regarding calls being made to your API, please keep in mind that ID tokens are meant to be used for authentication and not authorization. For the latter an access token is recommended.
Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.