I am trying to test a .NET MAUI app on iOS using MSAL. It works fine on Android, but I am struggling to test the same app on iOS due to this error: "This app cannot be installed because its integrity could not be verified."
The app runs without issues on the iOS simulator after adding the com.microsoft.adalcache
group in the entitlements.plist
in the keychain section, but when I try to deploy the app to an iOS device, I get the error mentioned before.
From what I've read, this happens because the entitlements.plist
is expected to match the provisioning profile. It seems there should be an option in Capabilities that says something like "KeyChain Sharing," but I can't find any capability referring to this in the Developer Portal.
If I remove the entitlements.plist
, the app deploys fine on the device, but MSAL does not work, throwing the following error:
"The application does not have keychain access groups enabled in the Entitlements.plist
. As a result, there was a failure to save to the iOS keychain.
The keychain access group '[Team].com.microsoft.adalcache' is not enabled in the Entitlements.plist
.
I have tried both, using a developer profile or an adhoc distribution profile with the same result.
Any ideas are welcome.
Finally, I managed to get it working! I’m not sure if the information I saw on other sites is incorrect or if Apple recently changed something, as several sources mentioned that the keychain-access-groups needed to be added to the entitlements.plist. I moved this key to the info.plist, and it finally worked!