sureshchahal / angular2-adal

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

Add angular 5 and replace AuthHttp with new Http Interceptor #77

Closed rjwijnen closed 1 year ago

rjwijnen commented 6 years ago

Yesterday i tried to make the library work on Angular 5 and use the new HttpClient. As i saw a lot of other library's changed to the http interceptor for adding the auth. token. I tried to implement the logic from the old Auth Http into a new Interceptor. I hope some of you can double check everything is working?

Lejdholt commented 6 years ago

can't say if the implementation of the interceptor is correct or not, but i want it

riisi commented 6 years ago

Also looking to use this...

hkusulja commented 6 years ago

@sureshchahal almost two months passed, any info about merge for Angular 5 (current) support? Tx

claudiuconstantin commented 6 years ago

What's the status for this one?

Mctalian commented 6 years ago

I have leveraged the AuthHttpInterceptor that is provided in this PR in my own project (copy and paste) and I can confirm that it works.

From what I see, there might just be a webpack warning due to dynamic requires if you were to try to use this with Angular 5, but this would at least enable folks to continue using this library with Angular 5.

Great work @rjwijnen , much appreciated!

rjwijnen commented 6 years ago

@ranveeraggarwal i removed the package lock.

rjwijnen commented 6 years ago

@sureshchahal could you look at this pull request and push it to master and NPM?

jmtrz commented 6 years ago

Hi Is this already fix i am getting this error

WARNING in ./node_modules/ng2-adal/node_modules/@angular/core/@angular/core.es5.js 5659:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ./node_modules/ng2-adal/node_modules/@angular/core/@angular/core.es5.js 5675:15-102 Critical dependency: the request of a dependency is an expression

If already fxed may i know how will i implement it in my proj 👍 tnx

saransh944 commented 5 years ago

@rjwijnen can you please create your own project for the version 5 changes and host it on NPM? Looks like @sureshchahal is not active on this anymore.

sureshchahal commented 5 years ago

Yes please, sorry I have lot at hand at moment. If someone wants to take ownership , I am happy to add them as owner also.

On Tue, Aug 7, 2018 at 3:23 PM saransh944 notifications@github.com wrote:

@rjwijnen https://github.com/rjwijnen can you please create your own project for the version 5 changes and host it on NPM? Looks like @sureshchahal https://github.com/sureshchahal is not active on this anymore.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/sureshchahal/angular2-adal/pull/77#issuecomment-411222536, or mute the thread https://github.com/notifications/unsubscribe-auth/ARLaHy_iCnuejP4g0b_eAsYlS9UE-c_7ks5uOhN7gaJpZM4QwIQS .

saransh944 commented 5 years ago

Thanks for the response @sureshchahal . Just a quick note, a lot of users of this repo including myself reviewed the changes by @rjwijnen and everything looks good. Is it possible for you to merge this change?

rjwijnen commented 5 years ago

@saransh944 in the meantime i switched to https://github.com/benbaran/adal-angular4 ..

saransh944 commented 5 years ago

@rjwijnen , thanks for the suggestion. Since we are talking about this, how are you handling the behavior that happens after the token is refreshed? I have noticed whenever the token refreshes, app is initialized 2-3 times, also Angular change detection does not work properly, i.e. ngModule breaks, @input changes from parent to child component doesn't propagate, etc. I am deleting the adal iFrame that gets created for the token refresh in case that is the reason for this weird behavior, but still I'm seeing these glitches. Do you have any recommendations on that?