如何使用Azure Proxy AD和ADAL在本地的SharePoint上进行身份验证?

问题描述:

我正在尝试调用在Azure代理AD发布的SharePoint 2013服务器上托管的Rest Web服务(如此处所述:

I'm trying to call a Rest Web Service Hosted on SharePoint 2013 server published with Azure Proxy AD (as describe here :Kirk Evans Blog. I'm using Adal to Auth on the Azure AD tenant:

var authContext = new AuthenticationContext(authority, false);
HttpClientHandler handler = new HttpClientHandler() { CookieContainer = new CookieContainer() };
HttpClient httpClient = new HttpClient(handler);
var result = authContext.AcquireToken("https:/AzureADAppUrl", "ID Apps",new UserCredential("login@domain.com","pass@word"));

这为我提供了一个访问令牌,即使我在 Bearer 授权标头或 AzureAppProxyAccessCookie Cookie中使用了此令牌.查询WCF Web服务时收到302重定向响应:无法识别Auth ... 如何在启用了Azure AD代理的Sharepoint服务器上进行身份验证?

This get me an access Token, but even If i use this token in the Bearer Authorization Header or in a AzureAppProxyAccessCookie cookie. I get a 302 redirection response when querying the WCF web service: the Auth is not recognized... How can I authenticate on an Azure AD Proxy enabled Sharepoint server?

应用程序代理当前仅支持交互式身份验证,因此您不能使用该服务发布API.

Application proxy currently only supports interactive authentication, so you can't publish an API using the service.

您不是第一个提出这个问题的人,因此我们正在研究如何在将来启用它.

You are not the first to ask this question, so we are investigating how to enable this in the future.

免责声明:我在App Proxy团队中工作☺

Disclaimer: I work in the App Proxy team ☺