Search code examples
javascriptazuredynamics-crmadal

Azure Active Directory authentication using -only- the adal javascript library


I am currently trying to design a SPA authenticating to a CRM application, based on the walkthrough here:

https://msdn.microsoft.com/en-us/library/mt595797.aspx

However, this will open a new window in the browser where the user can enter their username/password to log in. I need to feed it pre-defined usernames and passwords, and authenticate without this new window popping up, as the intent is to move this into a mobile app. I know that both in their Node as well as Python libraries, there is a function along the lines of "acquireTokenWithUsernamePassword". I was wondering if this is possible using only microsoft's adal.js library?


Solution

  • Adal.Js library only supports implicit flow. The username/password flow you need here is a confidential flow and is not supported by adal.js library as this library runs in a browser and is not capable of securing the user secrets.