abacritt / angularx-social-login

Social login and authentication module for Angular 17
630 stars 388 forks source link

Really...How to use it ? #752

Open Epameinondas-Theodoropoulos opened 4 months ago

Epameinondas-Theodoropoulos commented 4 months ago

So the main problem is how to use this library.

I mean I want all the steps because I have so many days that I am searching and i cannot find a solution.

So i did all the steps for the configuration and I have this in the HTML in my Angular app:

` <asl-google-signin-button type="standard" size="medium" text="signin_with"

`

So i get a SociaUser with an id and idToken.

Eveytime I refresh the page I got this . I cannot understand why. Eventhough I already clicked to log in with Google image

Eveytime I click the login google button then click the logout function this.authService.signOut(); I Get this error: image

Now the questions:

1) What to do with them? Should i send them to my backend and save them ? 2) If yes why to do that ? 3) If no why not ? 4) Is the id unique and the same all the time 5) Seriously what is the point of

    refreshAuthToken(GoogleLoginProvider.PROVIDER_ID);
  refreshAccessToken(GoogleLoginProvider.PROVIDER_ID);

Could you tell me where and when I need to use them ? I cannot find anything. Also i do not see in SocialUser and expirationTime or something like that.

6 ) I have a spring boot back end. I searched so many sites and they talk how to create an OAuth2 with Resource Server, Authorization Server etc... Does this library need to implement an OAuth2 in my backend or not ? I cannot understand if that is need it. 7) What is the difference to use this library and the back end. I mean it has any difference ? Must i use both ? What is the right way? 8) Give someone the steps and the general differences and the 'right' path. 9) I search for pages that show only to use the library and nothing more. And others that do so much complicated configuration with back end. What is the right way to it in the end ?

I want to log in and authorize my user in my app either with a custom email either with google and then the user will have his account with his information. That it. I believe is functionality that it is used everywhere...

I cannot believe that i am the only one that has these questions...