sureshchahal / angular2-adal

Angular 2 wrapper for adal.js
MIT License
41 stars 50 forks source link

acquireToken not working #78

Open danpardo opened 6 years ago

danpardo commented 6 years ago

Hi, I have this on my code, this.adalService .acquireToken("https://curogenslearning.onmicrosoft.com/studentsapi") .subscribe(token => { this._store.dispatch({ type: "AUTHENTICATED", payload: token });

It was working fine, until Friday, now it stop working, it is only on mi PC. A co=worker of mine pass me his node_modules folder I copy and paste it and it works fine, but it doesnt work if I run npm install my self, any ideas?

Thanks.

rjwijnen commented 6 years ago

Can you give more info about your complete app/config and the erro you get?

zoidfarb204 commented 6 years ago

I had the same issue this morning, i had to make sure i was using the old version of "adal-angular" (1.0.15) instead of the new (1.0.16). I was getting an unable to refresh token due to timeout message.

TimFST commented 6 years ago

We had the same thing too this week. As a temporary fix I have forked this repo and updated the package.json to only use version 1.0.14 of adal-angular.

We've now pointed the package.json in our project to reference the following and all is working again : "ng2-adal": "https://github.com/timfst/ng2-adal/tarball/master"

teban1812 commented 6 years ago

Same here, using angular 5.1.0 adal-angular 1.0.16 ng2-adal 2.0.0 I always get the same token (a cached one?), generated at the time the application run for the first time. So, it is always expired.

rjwijnen commented 6 years ago

I can also confirm the problem. When using 1.0.15 it works.

danpardo commented 6 years ago

@rjwijnen I am getting message error, Token renewal operation failed due to timeout when calling acquireToken method, it seems to be an issue with adal-angular version 1.0.16.

nkpatterson commented 6 years ago

Same here. Manually setting adal-angular to 1.0.15 works as a temporary workaround.

ben-m-lucas commented 6 years ago

Looks like this has been reported to adal-angular: https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/690

wvanderdeijl commented 6 years ago

As I commented there I think it is related to window.callBackMappedToRenewStates no longer being there. I'm not sure if this is really something the core adal library should fix or whether ng2-adal should fix this. That would mean a dependency on adal >= 1.0.16 or ng2-adal should be so flexible to try to look at both the old and new location of the callbacks

claudiuconstantin commented 6 years ago

This is related to #85 - ng-2 adal relies on adaljs properties _renewStates and _callBackMappedToRenewStates, which were made private in the latest version (a breaking change incompatible with semver standard...)