【发布时间】:2019-06-16 02:49:48
【问题描述】:
无法使用 Dialog API 和 ADAL 对 Office 加载项进行身份验证。
我正在尝试使用 Dialog API 和 ADAL 对用户进行身份验证。对话框打开正常,但我收到请求中指定的回复 url 与为应用程序配置的回复 url 不匹配的错误。回复 url 在代码和应用注册中都配置为对话 URL。
$("#btnSignin").click(function () {
var url = "https://localhost:44367/auth.html";
Office.context.ui.displayDialogAsync(url, { height: 40, width: 40 }, function (result) {
_dlg = result.value;
_dlg.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogMessageReceived, dialogMessageReceived);
});
});
URL - https://localhost:44367/auth.html 被配置为redirectUri,并且在调试时authcontext.config.redirectUri 也指向https://localhost:44367/auth.html?_host_Info=Excel$Win32$16.01$en-US$telemetry$isDialog"。
我不知道为什么它会给出错误,虽然 url 配置正确。还有其他要添加的 redirectUri 吗?
【问题讨论】:
标签: office-js adal office-addins adal.js office-web-app