应用之间的 azure 应用 authentication/authorization

azure app authentication/authorization between apps

我有一个 azure 手机,全部使用 authentication/authorization 和 facebook,一切都已设置并在我的移动应用程序上运行,我能够使用 facebook 进行身份验证并获得访问令牌。

我还有一个托管在 azure 中的网络应用程序 (ODATA),并且还使用 authentication/authorization 和 facebook,如果我尝试访问 ODATA 服务,它也能正常工作,它会将我重定向到 facebook 进行登录。

根据这篇文章 (https://azure.microsoft.com/en-us/blog/announcing-app-service-authentication-authorization/),我应该能够通过发送带有 acces_token 的 json 以静默方式或编程方式将访问令牌从移动应用程序发送到 Web 应用程序关键。

可能的问题是我是如何做到这一点的,是 header 中的访问令牌还是我应该在哪里写它我可以从中找到任何信息。我非常感谢可以指导我完成任务的代码示例或文章

The may question is how I do this, is that access token in the header or where should I write it I can find any information from it. I would really appreciate a code example or an article that can guide me to accomplish my task.

根据我的理解,您正在使用 Client-managed authentication 独立联系 facebook 然后从 facebook 检索 access_token,然后您可以利用 access_token 登录您的 azure 手机应用后端。

此外,您有一个 Azure Web 应用程序使用 authentication/authorization 和 facebook 并且 使用相同的 facebook 应用程序 ID。然后您想利用移动客户端中的 access_token 来访问您的另一个 Azure Web 应用程序。此时,您可以使用 azure web 应用程序登录并检索 authenticationToken,如下所示:

POST https://{your-app-name}.azurewebsites.net/.auth/login/facebook
Body {"access_token":"******"}

然后,您可以在访问您的 Azure Web 应用程序时利用 authenticationToken 并将其设置为 x-zumo-auth header,如下所示:

Get https://{your-app-name}.azurewebsites.net/api/values
Header x-zumo-auth:{authenticationToken}

此外,您可以在您的 Azure 移动应用程序中创建您的自定义 Web API 端点,详细信息您可以参考阿德里安霍尔关于 Custom HTTP Endpoints 的书。