Connect D365 using ADAL from HTML page from a Single Page Web Application
ADAL script can be downloaded from https://secure.aadcdn.microsoftonline-p.com/lib/1.0.17/js/adal.min.js
Create an Empty website and add an HTML page. use the below code for your HTML page.
[gist]b8262751bb55fd6f38755e6491a23acb[/gist]
After updating the code, Register an Application in Azure Active Directory. Follow this tutorial to understand how to Register an App in Azure AD and provide required permission for Dynamics 365.
make sure to use your local page URL as redirect URL in application registration for me I have used mine. To get your URL run the html web page from visual studio and copy the address from browser and use the URL in Redirect URI in app registration.
Replace the Org URL, Tenant ID, App ID, and Redirect page URL correctly.
Now we can test. Run the HTML page and once you run the data will populate.
Hope it helps.