简体   繁体   English

Office 365 API ADFS

[英]Office 365 API ADFS

I'm trying display an unread message count of an Exchange Online mailbox in a C# WPF application. 我正在尝试在C#WPF应用程序中显示Exchange Online邮箱的未读邮件计数。 We have ADFS (2008 R2) SSO implemented on-premises and use DirSync to Office365. 我们已经在本地实现了ADFS(2008 R2)SSO,并使用DirSync到Office365。 We always receive an authentication prompt when doing the request with the REST API, however SSO works (via ADFS) when accessing Outlook Web App. 使用REST API进行请求时,我们始终会收到身份验证提示,但是访问Outlook Web App时(通过ADFS)SSO可以工作。

I'm trying to access via this 我正在尝试通过访问

There is little documentation of using the REST API with ADFS deployed, and I'd like to know if the REST API is compatible with ADFS (2008 R2) SSO at all? 很少有关于在部署ADFS时使用REST API的文档,我想知道REST API是否与ADFS(2008 R2)SSO完全兼容? The documentation over on the REST API pages, has no mention at all of ADFS, despite it being a common authentication mechanism for Enterprise Office365 customers. 尽管REST API页面上的文档是企业Office365客户的通用身份验证机制,但在ADFS的所有文档中都没有提及。

Our Rest APIs do not support federated access, so even when you integrate your app with federation, the API access will not work. 我们的Rest API不支持联合访问,因此,即使您将应用程序与联合集成,该API访问也将无法使用。 You can however use OAuth2 to get an access token for the Rest APIs. 但是,您可以使用OAuth2获取Rest API的访问令牌。 In the OAuth2 flow you can however take advantage of federation, as OAuth2 will hit the authorize endpoint for consent, and the authorize endpoint will honor an existing sign-on session your app has with AAD (via ADFS). 但是,在OAuth2流程中,您可以利用联合身份验证,因为OAuth2将命中授权端点以征得同意,并且授权端点将兑现您的应用程序与AAD(通过ADFS)进行的现有登录会话。 So the user of your app does most likely not see the credential prompt, and your app get access tokens from the AAD Oauth2 token issuing endpoint following the Oauth2 protocol: https://msdn.microsoft.com/en-us/library/azure/dn645542.aspx . 因此,您的应用程序用户很可能看不到凭据提示,并且您的应用程序遵循Oauth2协议从AAD Oauth2令牌发行端点获取访问令牌: https ://msdn.microsoft.com/zh-cn/library/azure /dn645542.aspx Note as your app is developed in C# .net, you can fully take advantage of the OAuth2 auth library, ADAL, and you do not need to implement the protocol by yourself. 请注意,由于您的应用程序是使用C#.net开发的,因此您可以充分利用OAuth2身份验证库ADAL,并且无需自己实现协议。 We have many examples available and a good starting point is: http://www.cloudidentity.com/blog/2014/05/06/azure-ad-samples-on-github/ . 我们有许多可用的示例,一个好的起点是: http : //www.cloudidentity.com/blog/2014/05/06/azure-ad-samples-on-github/

Hope this helps. 希望这可以帮助。

Thanks, Matthias 谢谢,马蒂亚斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM