本文介绍了在Xamarin.iOS中使用带模拟器的Azure AD B2C-钥匙串问题(团队ID为null)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在开发Xamarin.Forms应用程序,并设置Azure AD B2C进行身份验证.我正在关注

一旦安装好,MSAL库将能够访问该钥匙串组,以在应用启动之间存储秘密.

I'm developing a Xamarin.Forms app, and setting up Azure AD B2C for auth. I'm following the official tutorial.Everything works flawlessly for Andorid, but I'm facing an issue with th iOS project.

I've setup everything mentioned in the tutorial but that is not enough. In this post, it describes how you should configure the iOS Bundle Signing to reference as custom entitlement Entitlements.plist. Otherwise you get this error:

Well, if you do that using the Simulator, it doesn't work since apparently, you cannot set in iOS Bundle Signing configuration any custom Entitlement when using the simulator (commented here).

Does this mean that I cannot test Azure AD B2C in the iOS simulator?

Edit: It seems you cannot set the custom Entitlement if you don't have an Apple Developer Program signing identity. Does this mean that I cannot test Azure AD B2C in the iOS simulator without being enrolled in the Apple Development Program?

Thanks!

解决方案

You can use custom entitlements including keychain access groups in iOS Simulator. It's done the same way you set custom entitlements for a device build, it's just disabled for simulator by default. Steps:

  1. Modify your custom Entitlements.plist to include keychain access groups:

    <key>keychain-access-groups</key>
    <array>
         <string>$(AppIdentifierPrefix)com.microsoft.adalcache</string>
    </array>
    

  2. Apply the entitlements to the iOS Simulator configuration in project settings:

Once you have this in place, the MSAL library will be able to access that keychain group to store secrets in between app launches.

这篇关于在Xamarin.iOS中使用带模拟器的Azure AD B2C-钥匙串问题(团队ID为null)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 17:02