AzureAD / azure-activedirectory-library-for-cordova

ADAL for Cordova
59 stars 111 forks source link

Plugin show SSO page in debug build but not release builds on Windows 10 #171

Open kromark opened 7 years ago

kromark commented 7 years ago

Using the plugin and the project sample on Windows10 UWP login works in debug compilation and shows Azure SSO, however when compiled in Release throws exception "TypeInitialization_Type_NoTypeAvailable" and fails to show Azure SSO.

This seems likely due to .NET Native Compiler optimizing ADAL away. Is there a fix for this? or assistance with rd.xml directives to ensure ADAL library gets into the compilation?

Repro Environment Details

Installed plugin version: cordova-plugin-ms-adal": "^0.10.1 Target Platform: Windows 10 Cordova and platform versions: 7.0.1 {} Installed platforms: android 6.2.3 ios 4.3.1 windows 5.0.0 Available platforms: blackberry10 ~3.8.0 (deprecated) browser ~4.1.0 osx ~4.0.1 webos ~3.7.0 Test device and OS version: Windows 10 Desktop x64 Are you using Cordova from command line or special Cordova IDE: no

krizroring commented 6 years ago

Same here, after debugging i found an error in the ADALProxy.js on line 100:

var nativeContext = new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(authority, validateAuthority);

returns undefined.

This was called when trying to get the SSO.

Installed plugin version: cordova-plugin-ms-adal": "^0.10.1" Target Platform: Windows 10 Cordova and platform versions: 8.0.0 Installed platforms: windows 5.0.0

VAndjelic commented 6 years ago

Same here, after debugging i found an error in the ADALProxy.js on line 100:

var nativeContext = new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(authority, validateAuthority);

returns undefined.

This was called when trying to get the SSO.

Installed plugin version: cordova-plugin-ms-adal": "^0.10.1" Target Platform: Windows 10 Cordova and platform versions: 8.0.0 Installed platforms: windows 5.0.0

I downgrade plugin version on 0.9.0 and now works ok with windows.

nickgdyer commented 6 years ago

Two days wasted trying to get to the bottom of this same issue. Thank you for the tip to downgrade. It worked a charm.

oleksandr-dziuban commented 6 years ago

Hello guys, any news regarding this issue? I have the same problem on Windows 10 UWP release build with v0.10.1