Azure Active Directory in AppBuilder app on device

3 posts, 0 answers
  1. David
    David avatar
    5 posts
    Member since:
    Mar 2011

    Posted 17 Sep 2014 Link to this post

    Sorry if this is a newbie question, or asked else where.  I did do some extensive searching, and found something close, but nothing specific to the issue I'm facing.

    I'm working with AAD and the Azure client library for javascript.   While my code is working fine in the simulator on the desktop(window pops up, user enters credentials, return token to app),  on the AppBuilder app on the device(ios to be specific) it gets to the point where it should launch the login window, and nothing happens.  Any help would be greatly appreciated.
  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 19 Sep 2014 Link to this post

    Hello David,

    Could your please specify if the issue is iOS-specific or is reproducible in Android? Also, please specify which JS library are you using in your app - the issue Might be deriving from it. We need to narrow down the issue to the code that is not executable or returns an error on the device.

    Some basic troubleshooting tips include the following:
    • If you are using the InAppBrowser plugin for Cordova to show the login dialog- attach an event handler using the addEventListener method to each of the events and examine the results.You can also specify as a second parameter of the InAppBrowser instance the '_system' target which will open the link in Safari.
    • Verify that there is no data stored locally that is used in the app and is not available to the device.
    • Examine any output from the device shown in the output console of your AppBuilder client of choice.
    • Verify that you are not running the app in the AppBuilder Companion app.

    If the above approaches do not solve the issue - please, provide a runnable sample so that we are able to investigate the issue locally.

    Best regards,
    Anton Dobrev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. David
    David avatar
    5 posts
    Member since:
    Mar 2011

    Posted 19 Sep 2014 in reply to David Link to this post

    Well it turned out to actually be a newb question.  After going through the MicrosoftServiceClient code(thank you Microsoft for providing a non-minified version), I discovered that calling login on the client before the deviceready event fired was the root of the issue.  The service client can't determine that it is using Cordova/Phonegap until that occurs, and doesn't try to access the InAppBrowser plug-in. There's actually a comment in the code about it.  Once I delayed calling it until that occurred, everything worked as expected.
Back to Top