AzureAD / azure-activedirectory-library-for-js

The code for ADAL.js and ADAL Angular has been moved to the MSAL.js repo. Please open any issues or PRs at the link below.
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/adal-angular
Apache License 2.0
627 stars 372 forks source link

Upgrade to Angular 6.0 - Issue due to deprecation of shims #747

Closed silver-stack closed 6 years ago

silver-stack commented 6 years ago

Hello, I have recently upgraded one of our projects that uses adal-angular from version 5.2 to 6.0 and we are receiving the following error within browser console:

adal.js?5e4c:1 Uncaught ReferenceError: global is not defined 
at Object../node_modules/expose-loader/index.js?AuthenticationContext!./node_modules/adal-angular/lib/adal.js-exposed (adal.js?5e4c:1)

After some further investigation I believe that this issue is related to the removal of shims from version 6.0. There is more information here: #9827 (comment)

To assist a little, we are importing as follows:

import {adal, AuthenticationContext} from '../../../../node_modules/adal-angular/lib/adal.js'; 
import 'expose-loader?AuthenticationContext!../../../../node_modules/adal-angular/lib/adal.js'; 

I'll admit that I know little about shims, however if there is a work around that you know of it would be much appreciated.

Unfortunately I am not able to update the title, I should have wrote shims being made obsolete (not deprecated).

Kind Regards, silver-stack

evnexus commented 6 years ago

Hi silver-stack,

Have you tried this solution? https://github.com/angular/angular-cli/issues/8160#issuecomment-386153833

rohitnarula7176 commented 6 years ago

@silver-stack adal-angular 5.2 is not written by Microsoft and hence it is out of scope for the library. Closing this issue.

ErikErkelens commented 6 years ago

Some guidance on how to use the library with Angular 6 would be welcome. The following was written by Microsoft and has the same issue described here https://blogs.msdn.microsoft.com/premier_developer/2017/04/26/using-adal-with-angular2/

JACrazy commented 5 years ago

This blog post by Microsoft shows how to use adal.js with Angular 4+, the example is done with Angular-CLI 7.0.0-rc.1. https://blogs.msdn.microsoft.com/premier_developer/2018/10/24/using-adal-js-with-angular4/