从Azure AD认证应用程序服务后,如何获取用户和令牌详细信息?

发布于 2025-01-25 06:31:39 字数 347 浏览 2 评论 0原文

我为App Services中的Azure托管了前端的React应用程序。我还有另一个用于为前端应用创建REST API的NodeJS应用程序。该应用程序托管在另一个应用程序服务上。

现在,我想使用Azure Active Directory集成前端应用程序的AD身份验证,我设法使用Easy Auth Process进行了操作。但是,一旦用户认证,我不知道如何获得(或传递到前端)用户和令牌细节。

查询的第二部分是,我想使用令牌将REST API传递到标题中并在后端验证它来保护我的REST API。我已经浏览了各种Microsoft文档,但我无法弄清楚如何做到这一点。

请帮助我获取用户和令牌详细信息。并请建议如何保护我的休息API。

I have a React Application for the Front end hosted on Azure in App Services. I also have another NodeJS app that I am using to create REST APIs for the front-end App. This App is hosted on another App Service.

Now, I want to integrate AD authentication for the front-end app using Azure Active Directory, which I have managed to do using the Easy Auth process. But I don't know how to get (or pass to the front end) the user and token details once the user is authenticated.

The second part of the query is, that I want to use the token to secure my REST APIs by passing it in the header and validating it in the backend. I have gone through various Microsoft documentation but I am not able to figure out how to do this.

Please help me in getting the user and token details. And please suggest how to secure my REST APIs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文