I have created an angular-adal SPFx project, now when I'm trying to acquire the token. It always displays a message:
Token renewal operation failed due to timeout
adal.acquireToken("Dynamic 365 API", (error, token)=>{
console.log("error");
});
EDIT
After using the inbuilt spfx AadHttpClient
, the issue which I am Facing.
Error: The requested operation is part of an experimental feature that is not supported in the current environment.
Code
this.context.aadHttpClientFactory.getClient('https://tenant.onmicrosoft.com/{ApplicationId}').then((client: AadHttpClient): void => {
client.get('https://graph.microsoft.com/v1.0/me', AadHttpClient.configurations.v1).then((response: HttpClientResponse): Promise<JSON> => {
debugger;
return response.json();
})
.then((responseJSON: JSON): void => {
debugger;
var claimsTable = this.domElement.getElementsByClassName("azFuncClaimsTable")[0];
for (var key in responseJSON) {
var trElement = document.createElement("tr");
// trElement.innerHTML = `<td class="${styles.azFuncCell}">${key}</td><td class="${styles.azFuncCell}">${responseJSON[key]}</td>`;
claimsTable.appendChild(trElement);
}
});
});
Line where error comes
client.get('https://graph.microsoft.com/v1.0/me', AadHttpClient.configurations.v1).then((response: HttpClientResponse): Promise<JSON> => {
Image Description
Thanks for the help!