The document noted in the message shows the use of ADAL.net, which uses the Oauth Auth stream to access the web API. ADAL.js, on the other hand, is intended for use with SPAs and uses an Oauth implicit grant .
Older versions of ADFS do not support the implicit flow of grants (as stated in Github's answers). ADFS 2016 supports implicit grant support. Below is a documented sample of using ADAL.js for ADFS 2016.
source share