I used MSAL JS for authenticating user & thereafter calling acquireTokenPopup(scopes) for Access Token.
I am getting the access token, but cannot use it as it says Invalid Signature. (checked in jwt.io too - same error)
Over the forum I found it is due to Graph adding nonce. What will be the solution? Please help.
Following is the code.
tenantConfig = {
scopes: ["directory.read.all"]
};
this.clientApplication.acquireTokenSilent(this.tenantConfig.scopes).then( function (accessToken) {
},
function (error) {
console.log(error);
this.clientApplication
.acquireTokenPopup(this.tenantConfig.scopes)
.then(
function (accessToken) {
console.log("access token " + accessToken);
},
function (error) {
alert(error);
}
);
}
);