Git Product home page Git Product logo

Comments (6)

RandalliLama avatar RandalliLama commented on August 22, 2024

@fw224 Was the Company Portal app installed on the device where this repros?

from azure-activedirectory-library-for-cordova.

BartNetJS avatar BartNetJS commented on August 22, 2024

Same issue here. On iOS it is working, on android the type cast exception occurs
The company portal app is indeed installed on the device

from azure-activedirectory-library-for-cordova.

yucaowang avatar yucaowang commented on August 22, 2024

+1
Any update on this bug? After uninstalled Company Portal it won't repro. Anyone knows the root cause?

from azure-activedirectory-library-for-cordova.

RandalliLama avatar RandalliLama commented on August 22, 2024

FYI @weijjia

I think issue here is that if the Company Portal is installed then the Android version of ADAL uses that to get tokens. The cordova version of ADAL depends on the Android version of ADAL. When Android ADAL talks the Company Portal a different object type that the Cordova version of ADAL isn't prepared to deal with causes a crash.

We've seen this issue in at least one other context as well and are working on a fix, but it may require an update to both Cordova ADAL and the Company Portal.

from azure-activedirectory-library-for-cordova.

weijjia avatar weijjia commented on August 22, 2024

@RandalliLama Sorry I just saw the issue. For the crash stack trace, I don't think it even starts to talk to company portal. It looks like the crash happens inside the readTokenCacheItems, which contains the authContext.getCache. In android version of ADAL, the getCache method will check if we can switch to broker, it seems in this particular case, the existence of Company Portal makes adal-android switch to broker, and we're retuning a new anonymous inner class implementing the interface ITokenCacheStore. When authContext.getCache returns, the cordova plugin is trying to cast it to the DefaultTokenCacheStore...oops, exception is thrown here. The returned anonymous inner class implementing the interface ITokenCacheStore cannot be casted to DefaultTokenCacheStore.

from azure-activedirectory-library-for-cordova.

danyoel avatar danyoel commented on August 22, 2024

Also seeing this issue on a WP8.1 device, but not the emulator. Packaging is Windows Universal app.

Exception was thrown at line 208, column 17 in ms-appx://com.microsoft.research.selfsourcing.mobile/www/plugins/cordova-plugin-ms-adal/src/windows/ADALProxy.js
0x80004002 - JavaScript runtime error: No such interface supported
System.InvalidCastException: Specified cast is not valid.
   at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags)
WinRT information: System.InvalidCastException: Specified cast is not valid.
   at System.StubHelpers.InterfaceMarshaler.ConvertToNative(Object objSrc, IntPtr itfMT, IntPtr classMT, Int32 flags)

The relevant line, as @RandalliLama and @weijjia suggest, is reading the token cache:

win(context.tokenCache.readItems().map(function(item) {

from azure-activedirectory-library-for-cordova.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.