Xamarin droid的MSAL登录重定向的新预览失败 [英] New preview for MSAL login redirect for Xamarin droid fails

查看:103
本文介绍了Xamarin droid的MSAL登录重定向的新预览失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在新的MSAL预览版v.1.1.0中使用Xamarin Forms在Visual Studio 2015中.该应用程序调用PublicClientApplication.AcquireTokenAsync,它会在移动设备上的Chrome中拉出登录表单.登录成功,但是重定向后收到错误消息无法访问此站点.msal[我的应用程序ID]://auth/?code = [auth代码] ...上的网页可能是暂时的下来,或者它可能已经永久地移到了新的网址.

I'm using Xamarin Forms in Visual Studio 2015 with the new MSAL preview v.1.1.0. The app calls the PublicClientApplication.AcquireTokenAsync which pulls up the login form in Chrome on the mobile device. The login is successful, but when it redirects I get the error message "This site can't be reached. The webpage at msal[my app id]://auth/?code=[auth code]... might be temporarily down or it may have moved permanently to a new web address.

单步执行该应用程序时,我看到PublicClientApplication的redirect uri属性设置为msal [我的应用程序ID]://auth.这就是我输入到Azure B2C租户应用程序中的自定义重定向uri.

When stepping through the app I see that the PublicClientApplication's redirect uri property is set to msal[my app id]://auth. And that is the same custom redirect uri that I entered into the Azure B2C tenant application.

对于该错误,有人对我应该检查的内容有什么建议吗?谢谢.

Does anyone have any suggestions from that error of what I should check? Thanks.

推荐答案

您应该查看 使用MSAL 示例将Azure AD B2C集成到Xamarin表单应用中.

You should check out the Integrate Azure AD B2C into a Xamarin forms app using MSAL sample.

此问题通常有以下原因:

This issue generally has the following causes:

  • 您没有在
  • You haven't configured your RedirectURI correctly in your AndroidManifest.xml, double check that you've populated both the scheme and the host correctly, where scheme only includes msal[APPLICATIONID] without colon, slashes or 'auth' and the host while the host only includes 'auth'
  • You haven't configured your RedirectURI correctly in your MainActivity.cs, double check that it matches the full redirect URI, meaning that it does include colon, slash and 'auth' like so: msal[APPLICATIONID]://auth
  • You're missing the OnActivityResult method that calls the AuthenticationContinuationHelper.

这篇关于Xamarin droid的MSAL登录重定向的新预览失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆