My Mac Catalyst app fails with a "MissingEntitlement" error when accessing keychain/secure storage, while the same code works perfectly on iOS. I have tested this extensively on macOS using Visual Studio Code on a MacBook, trying both automatic and manual provisioning approaches - both result in the same MissingEntitlement error during keychain operations.
Error Message: "An error occurred during OTP verification: Error adding record: MissingEntitlement"
Environment :
- Platform: Mac Catalyst (.NET 9.0)
- Issue: Keychain access fails on macOS, works on iOS
- Development: Using .NET MAUI
What I've Tried :
Entitlements Configuration Added keychain-access-groups to Entitlements.plist: xml
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.example.myapp</string>
</array>
Project Signing Setup (.csproj configuration) :
<PropertyGroup Condition="'$(TargetFramework)'=='net9.0-maccatalyst'">
<EnableCodeSigning>true</EnableCodeSigning>
<ProvisioningType>manual</ProvisioningType>
<DevelopmentTeam>TEAM_ID</DevelopmentTeam>
<CodesignKey>Apple Development: Name (XXXXXXXXXX)</CodesignKey>
<ProvisioningProfile>PROVISIONING_PROFILE_UUID</ProvisioningProfile> <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.plist</CodesignEntitlements>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>
Has anyone encountered similar issues with Mac Catalyst keychain access? Any insights on proper entitlement configuration would be greatly appreciated!