office加载项asp.net MVC应用程序无法验证AzureAD获取错误:IDX10311 [英] office add-in asp.net MVC Application cannot Authenticate against AzureAD getting error: IDX10311

查看:590
本文介绍了office加载项asp.net MVC应用程序无法验证AzureAD获取错误:IDX10311的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2015 中创建了一个新的 ASP.NET MVC WebApplication ,其中包含使用学校或工作的选项帐户根据 AzureAD 进行身份验证。这个工作正常。



然后我把Project转换为Office Project的应用程序作为Excel任务窗格加载项。



然后,当我启动应用程序时,它启动一个Excel电子表格,其中显示了使用Microsoft登录的请求的任务窗格。选择帐户或选择使用其他帐户登录时,我会在新的浏览器中重定向到login.mocrosoft.com,但会收到以下错误:


IDX10311:RequireNonce为'true'(默认),但validationContext.Nonce
为空。无法验证随机数。如果您不需要检查
随机数,请将OpenIdConnectProtocolValidator.RequireNonce设置为false。


显示的URL在新的浏览器中, https:// localhost:44300 / ,因为我在本地进行调试。 / p>

这是一个问题,因为身份验证源于任务窗格任务窗格 iFrame 相同?如果是这样,可能是以下问题的一个类似的问题: OpenIDConnect Azure网站托管在Dynamics CRM Online中的iFrame



我可以设置 RequiredNonce 假?如果是这样吗?



请帮助我创建一个 Office应用程序认证针对 AzureAD / Office365Domain ? 我认证的是我的私人免费MSDN订阅,希望将来使用该公司的Office365 AzureAD。



我正在使用 Office2016 VS2015 Microsoft.Office.js 版本1.1.0.9。

解决方案

我通过添加 https://login.microsoftonline.com https:// login .live.com 应用程序清单中的应用程序域。我不明白技术,所以我不能评论为什么这个工作,但解决方案适用于我。


I created a new ASP.NET MVC WebApplication in Visual Studio 2015 with the options to use School or Work Accounts to authenticate against an AzureAD. This worked fine.

Then I converted the Project to an App for Office Project as an Excel Task-Pane Add-In.

Then when I start the Application it starts an Excel Spreadsheet with a taskpane showing the request to login with Microsoft. When selecting an account or choosing to log-in with another account I get redirected to login.mocrosoft.com in a new Browser but receive the following error:

IDX10311: RequireNonce is 'true' (default) but validationContext.Nonce is null. A nonce cannot be validated. If you don't need to check the nonce, set OpenIdConnectProtocolValidator.RequireNonce to 'false'.

The URL shown in the new browser is "https://localhost:44300/" since I am debugging locally I take it.

Is this an issue because the authentication originates from the Task-Pane? Is the Task-Pane the same as an iFrame? If so it could be a similar issue as the following problem: OpenIDConnect Azure Website hosted in an iFrame within Dynamics CRM Online

Can I simply set the RequiredNonce to false? If so how?

Please help me to create an App for Office with Authentication against an AzureAD / Office365Domain? The AzureAD I am authenticating against is my private Free MSDN Subscription currently, wanting to use the company's Office365 AzureAD in future.

I am using Office2016, VS2015, Microsoft.Office.js Version 1.1.0.9.

解决方案

I solved my issue by adding https://login.microsoftonline.com and https://login.live.com to the App Domains in the App Manifest. I dont understand the technology, so I cannot comment on why this works, but the solution works for me.

这篇关于office加载项asp.net MVC应用程序无法验证AzureAD获取错误:IDX10311的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆