【问题标题】:Can't get the AutodiscoverSample in the Exchange EWS SDK to work - auth with Office 365无法让 Exchange EWS SDK 中的 AutodiscoverSample 工作 - 使用 Office 365 进行身份验证
【发布时间】:2011-11-22 04:47:53
【问题描述】:

我下载了 Exchange Server 2010 SP1 SDK 以开始使用 Exchange Web 服务。

我做的第一件事是打开 AutodiscoverSample 以查看 Autodiscover 的工作原理。

我有两个 Exchange 帐户,每个帐户位于不同的 Exchange 系统上。

charlie@kindel.com 托管在 Exchange(Microsoft Edu/Friends & Family)上。

cek@fiinom.net 在 Office 365 上。

我无法让它连接到 Office 365 系统。

我可以在 Outlook 和 https://www.testexchangeconnectivity.com 网站上成功地自动发现。

如果运行示例:

AutodiscoverSample.exe charlie@kindel.com true charlie@kindel.com <password> kindel.com

效果很好。

如果我将示例运行为: AutodiscoverSample.exe cek@fiinom.net true cek@fiinom.net <password> fiinom.net

我明白了

=? Trying 'cek@fiinom.net' at 'https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml'
-! Info: System.Net.WebException: The remote server returned an error: (401) Unauthorized.

谁能提供任何关于这里可能发生的事情以及我如何解决它的见解?

拥有 Office 365 帐户的其他人能否检查 AutodiscoverSample 是否适合您?

【问题讨论】:

  • FWIW,我意识到 Exchange 2010 SP1 SDK != EWS 1.1 SDK。我现在可以使用 EWS AutodiscoverService 类。但这并不能解释这个样本有什么问题。

标签: .net exchange-server exchangewebservices office365


【解决方案1】:

我不知道 AutodiscoverSample.exe 是如何工作的,但是通过处理我的代码(直接 Win HTTP)和 Office 365,自动发现将被重定向到不同的域(outlook.com),所以如果使用凭据缓存,你必须提供至少 2 个域的凭据,即使用户名/密码相同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-24
    • 1970-01-01
    • 2023-02-08
    • 2016-06-04
    • 1970-01-01
    • 2014-09-07
    • 2011-09-20
    • 2015-06-27
    相关资源
    最近更新 更多