[Bug] Xamarin: Make library linker-safe
See original GitHub issueWhich Version of MSAL are you using ? MSAL 4.8.0
Platform Xamarin.Android & Xamarin.iOS
Repro Enable full linking in Xamarin project iOS: Android:
Expected behavior Library works without any (or minimal) adjustments needed
Actual behavior
Usage of the library fails (see error below) because needed classes (or their constructors/methods) were removed/linked away. Affected classes are, amongst others, Microsoft.Identity.Client.Core.IdToken
, Microsoft.Identity.Client.Instance.TenantDiscoveryResponse
, Microsoft.Identity.Client.Instance.Discovery.InstanceDiscoveryResponse
.
Previously (with v4.7.1) I only had to manually add class Microsoft.Identity.Client.BrowserTabActivity
to the LinkDescription.xml, but with v4.8.0, many more classes need to be excluded from linking manually.
Possible Solution It would be great if the SDK could be made linker-safe so that I wouldn’t have to care and exclude classes manually. Afaik, this can be done by Attributes as described here or here
Additional context/ Logs / Screenshots
MSAL.Xamarin.iOS.4.8.0.0.MsalClientException: ErrorCode: json_parse_failed Microsoft.Identity.Client.MsalClientException: Failed to parse the returned id token. —> Microsoft.Identity.Json.JsonSerializationException: Unable to find a constructor to use for type Microsoft.Identity.Client.Core.IdToken. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path ‘ver’, line 1, position 7. at Microsoft.Identity.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Microsoft.Identity.Json.JsonReader reader, Microsoft.Identity.Json.Serialization.JsonObjectContract objectContract, Microsoft.Identity.Json.Serialization.JsonProperty containerMember, Microsoft.Identity.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x000d5] in <d6f56669a77644b7bf251a9335804604>:0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top GitHub Comments
My bad, somehow the project decided to downgrade MSAl to 4.7.1 again, sorry for the false alarm!
Ok, able to repro the issue and found a fix. Will be releasing 4.8.1 soon.