abacritt / angularx-social-login

Social login and authentication module for Angular 17
634 stars 387 forks source link

using new google AUTHENTICATION libs #507

Closed Jin-K closed 2 years ago

Jin-K commented 2 years ago

this is just some work in progress, trying to make it work with the new Google Identity Services library: https://developers.google.com/identity/oauth2/web/guides/overview

Heatmanofurioso commented 2 years ago

Hi @Jin-K Any specific reason you've closed this PR?

ravitejabommakanti commented 2 years ago

Hi @Jin-K May I know why you have closed it ?

Jin-K commented 2 years ago

Hi, it was a draft and I tried to delete it but only saw a close button. I'm not so used to contributions on GitHub.

I decided to close it because it started becoming messy code while trying to preserve the current structure and I'm not fan of the button wrapper I ended writing there, because other providers are not doing it and are implementing the signIn method (button click handler).

Also, it needs NgZone somewhere to trigger change detection because the google library isn't calling the callback methods we pass in the right zone.

With all this things, I thought it became too much changes.

But if introducing that button wrapper is not a problem, someone can maybe create a branch from this changes here. I would even recommend to load the google client on module initialization (APP_INITIALIZER), this way the button can be rendered a little bit before.

ravitejabommakanti commented 2 years ago

Any plans to merge the PR ? Please confirm.

Heatmanofurioso commented 2 years ago

@Jin-K Weren't you able to make an implementation without the button?

From my searches, I also haven't found a solution

Jin-K commented 2 years ago

@Jin-K Weren't you able to make an implementation without the button?

From my searches, I also haven't found a solution

@Heatmanofurioso no I wasn't with the Identity lib, but I've been working on a personal project this weekend and I've been able to authenticate AND authorize via 1 single popup, I'm using angular-oauth2-oidc for that. So I don't use the new Google lib at all there, only angular-oauth2-oidc which calls the google oauth2 oidc endpoints. This way I'm receiving the idToken + accessToken from 1 method call.

I'll push the repo very soon.

Heatmanofurioso commented 2 years ago

@Jin-K First off, thank you for all your help here, and sorry for not pitching in more, but I've been really stomped on other things recently.

I didn't quite get your last line in comment. You'll try and push it onto this project as an alternative authentication method?

If that were so, we could merge this one so people have a functioning mechanism, and then add the other as an alternative, if you and the rest of the community agree with so.