如何为两个应用程序服务使用相同的身份提供商?

发布于 2025-02-07 07:19:28 字数 630 浏览 1 评论 0原文

我有两个独立的App Services在Azure中托管。其中一个是一个网站(ASP。NET),另一个是网络API。我使用身份验证刀片在第一个Web应用程序(网站)上设置了身份提供商。这迫使用户登录应用程序,然后才能访问任何页面。

网站身份验证

我还想在Web API上设置身份验证。当我使用目录中的现有应用程序注册设置身份验证时,我将不再能够从网站访问任何Web API服务。如何将同一设置用于应用程序服务并访问我的服务?

webServices身份验证

“

I have two separate app services hosted in Azure. One of them is a website (ASP . NET) and the other is a web API. I set up an identity provider on the first web app (website) using the Authentication blade. This forces the user to log in to the application before she can access any pages.

WebSite Authentication
App Service Authentication

I want to also set up authentication on the web API. When I set up the authentication using an existing app registration in the directory, I am no longer able to access any of the web API services from the website. How can I use the same setup for both the app services and also access my service?

WebServices Authentication

App Service

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看透却不说透 2025-02-14 07:19:28

如何为两个应用服务使用相同的身份提供商?

  • 是的,我们可以为两个应用程序服务使用相同的身份提供商。
  • 我已经创建并部署了两个应用程序ASP.NET和Web API
  • 的应用程序的身份提供程序
  • 添加了试图访问应用程序
AADSTS50011: The redirect URI specified in the request does not match the redirect URIs configured for the application
  • ,在Azure Portal =&gt中访问Web API

    时访问了以下错误; Active Directory => App Registrations =>在拥有的应用程序下,单击您的应用程序名称=>单击重定向uris,在添加 下重定向uris

  • 添加带有/。auth/auth/login/aad/aad/aad/callback P>

  • 的重定向URI后缀,现在可以访问两个应用程序而无需任何错误

”“在此处输入图像描述”

“在此处输入图像说明”

  • 请确保在重定向URL选项中添加两个应用程序服务URL < /em>

“在此处输入图像描述”

How can I use the same identity provider for the two app services?

  • Yes, We can use same Identity provider for the two App services.
  • I have created and deployed two applications ASP.Net and Web API
  • Added Identity providers for both the applications
  • Tried to access the applications, got the below error while accessing the WEB API
AADSTS50011: The redirect URI specified in the request does not match the redirect URIs configured for the application
  • In Azure Portal => Active Directory =>App registrations =>Under Owned Applications , click on your application name => click on Redirect URIs, Under Add Redirect URIs

  • Add the redirect uri suffixed with /.auth/login/aad/callback

  • Now Iam able to access both the applications without any errors

enter image description here

enter image description here

  • Make sure to add both app service URLs in redirect URL option

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文