繁体   English   中英

如何使用 azure Ad 和 .net 核心处理微服务中的身份验证?

[英]How to handle authentication in micro services using azure Ad and .net core?

具有微服务架构的网络核心。 I have web application and API 1 and API 2.I have registered 3 applications in azure AD for web, API1 and API2. 目前,我正在 web 应用程序中生成令牌,方法是期望 API1 的用户名和密码。 此流程运行良好。 现在我又添加了一个 API2 的 API。 现在我想使用用户上下文从 API1 到 API2 进行身份验证。 API2 中的代码需要诸如角色、用户名和组等声明。所以我想在 API1 中为 API2 生成带有用户上下文的令牌。 我没有找到完成此任务的方法。 有人可以帮助我采取适当的方法来实现这一目标。 任何帮助将不胜感激。 谢谢

您应该考虑On-Behalf-Of flow

在此处输入图像描述

我注意到您有另一篇关于 OBO 流程的帖子。

client_idclient_secret应该来自 Web API 网关应用程序。

You should expose an API in your Protected API application (you can get the Application ID URI like this format api://<application-client-id of Protected API application> in this step) and add the permission in your Web API Gateway application .

scope应该是api://<service_application_id of the Protected API application>/.default

由于以上内容与本帖无关,我就简单提一下。 希望能帮助到你。

暂无
暂无

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

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