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

ASP.NET Core 2 Angular 4 adal_angular issue - window not defined #739

Closed bparkerhsd closed 6 years ago

bparkerhsd commented 6 years ago

I am using the ASP.NET Core 2 Angular 4 template in Visual Studio 2017. When the code is in the AuthenticationContext (adal_angular4) function, a window.Logging statement is encountered. This results in a window not defined error. It appears the window object is not available.

Is there way for this library to not use the window object?

rohitnarula7176 commented 6 years ago

@bparkerhsd We already introduced a check in the library to check if the window object is undefined before we try to use it. Please see below: https://github.com/AzureAD/azure-activedirectory-library-for-js/blob/f20a0ddde2faef87f87aae8e6aafe4de2c6b7a50/lib/adal.js#L192

Are you using the latest version of the library. Also we have to use the window object as the library works receives all responses via a 302 response which reloads the webpage. In order to retain the app state we have to make use of the window object.