简体   繁体   English

在 Azure 中结合 Web 和移动应用程序时的身份验证

[英]Authentication when combining Web and Mobile Apps in Azure

I follow this article: develop-mobile-apps-with-csharp-and-azure for combining my already fonctional Xamarin app with an small web site use by some admins.我关注这篇文章: develop-mobile-apps-with-csharp-and-azure ,用于将我已经具有功能的 Xamarin 应用程序与一些管理员使用的小型 web 站点结合起来。 In the article, we only need to add this in my web.config:文章中,我们只需要在我的web.config中添加这个:

<authentication mode="Forms">
  <forms loginUrl="/.auth/login/aad" defaultUrl="/Home" timeout="480"/>
</authentication>

This addition work good, but after logging in and click on the ugly link "Return to you web site" provided by Azure, I always got redirect on the root of the site (that display: This mobile app is up and running).这个添加效果很好,但是在登录并点击 Azure 提供的丑陋链接“返回给你 web 站点”后,我总是在站点的根目录上重定向(显示:此移动应用程序已启动并运行)。 I try to add defaultUrl to redirect to the /Home page without success.我尝试添加 defaultUrl 以重定向到 /Home 页面但没有成功。 Any idea?任何想法?

You have probably not set the "Allowed External Redirect URLs".您可能没有设置“允许的外部重定向 URL”。 This feature allows you to call the authentication backend with a specific Redirect URL.此功能允许您使用特定的重定向 URL 调用身份验证后端。 On a successful authentication, it then redirects to one of the valid authentication redirects.在成功的身份验证后,它会重定向到有效的身份验证重定向之一。 You need to specify the url during the request by specifying a post_login_redirect_url .您需要在请求期间通过指定 post_login_redirect_url 来指定post_login_redirect_url For example:例如:

<forms loginUrl="/.auth/login/aad?post_login_redirect_url=/Home/Index" timeout="480"/>

For more information, see the docs有关更多信息,请参阅文档

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

相关问题 Azure Mobile Apps自定义身份验证 - Custom Authentication with Azure Mobile Apps 如何使用Azure Active Directory向天蓝色的移动/ Web应用程序添加简单身份验证? - How to add simple authentication to azure mobile/web apps with Azure Active Directory? Azure移动应用Facebook身份验证停止工作 - Azure Mobile Apps Facebook Authentication stopped working Azure移动服务和Azure Web App身份验证 - Azure Mobile Service and Azure Web App authentication 两个Web应用程序之间的Azure身份验证 - Azure Authentication between two Web Apps Azure Mobile Apps身份验证-身份验证响应的格式无效 - Azure Mobile Apps authentication - invalid format of the authentication response Azure Mobile Web Services测试页面的身份验证 - Authentication for Azure Mobile Web Services test pages Azure移动应用程序身份验证:允许用户选择提供商 - Azure mobile Apps Authentication: Allow users choose provider 多个应用程序使用单个Azure移动服务进行实时身份验证? - Multiple apps using a single Azure Mobile Service for Live Authentication? Azure移动服务 - 我们所有应用的自定义身份验证提供程序 - Azure Mobile Services - custom authentication provider for all our apps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM