abacritt / angularx-social-login

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

{"error":"popup_closed_by_user"} #504

Closed DailisLangovskis closed 2 years ago

DailisLangovskis commented 2 years ago

Hello, I was trying to use google sign in after the last patch, (Thank You for that as well), but now I stumbled on this error: {"error":"popup_closed_by_user"}, comes of code_line I tried clearing all my Chrome and Firefox browser cache, as mentioned if few forums, but no luck. Anyone else is now experiencing this?

AyuDiego commented 2 years ago

Same here, facebook login perfect but when i try to call service whit these provider the same error :/. And i try to clear coockies and all i saw but nothing works

oliverfrost commented 2 years ago

I tried to implement everything from scratch using only Google`s JS API library and got the same error. So basically @abacritt/angularx-social-login has nothing to do with it.

There is a thread with lots of suggestions how to fix the problem but none of them worked for me: https://stackoverflow.com/questions/48683320/google-sso-login-error-popup-closed-by-user

The only workaround I found so far is to use redirect instead of opening Google`s login screen in a separate window:

 providers: [{
            id: GoogleLoginProvider.PROVIDER_ID,
            provider: new GoogleLoginProvider(
              'clientId',
              {
                  scope: 'email',
                  ux_mode: 'redirect'
              }
            )
          }]

And then extract 'id_token' from query parameters in url.

veeravetrivel commented 2 years ago

Same for me too. Any improvement or how to be solved?

AyuDiego commented 2 years ago

Finally I need a solution so I took firebase and works.

El El jue, 26 may 2022 a las 9:35, veeravetrivel @.***> escribió:

Same for me too. Any improvement or how to be solved?

— Reply to this email directly, view it on GitHub https://github.com/abacritt/angularx-social-login/issues/504#issuecomment-1138253559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVI6Y6ERB3ZPNYKHTYPZKDVL4SSJANCNFSM5WW6RFVA . You are receiving this because you commented.Message ID: @.***>

theophane-girard commented 2 years ago

any news ? :)

davidmr163 commented 2 years ago

Hey, I found a solution that worked for me. Inside app.module.ts you have to add the following code in your providers:

providers: [
        {
          id: GoogleLoginProvider.PROVIDER_ID,
          provider: new GoogleLoginProvider(
            'clientId', {
              scope: 'email',
              plugin_name: 'login-app'
            }),
        }
      ], 
      onError: (err: any) => {
        console.error(err);
      },
    } as SocialAuthServiceConfig,
  },
  ],

where plugin_name must be the name you provided for your project in the google oauth api.

Hope this can help someone in need :)

kartik1430 commented 2 years ago

Hello, I was trying to use google sign in after the last patch, (Thank You for that as well), but now I stumbled on this error: {"error":"popup_closed_by_user"}, comes of code_line I tried clearing all my Chrome and Firefox browser cache, as mentioned if few forums, but no luck. Anyone else is now experiencing this?

same problem..Did anyone resolve this ?

franlaraa commented 2 years ago

Hey, I found a solution that worked for me. Inside app.module.ts you have to add the following code in your providers:

providers: [
        {
          id: GoogleLoginProvider.PROVIDER_ID,
          provider: new GoogleLoginProvider(
            'clientId', {
              scope: 'email',
              plugin_name: 'login-app'
            }),
        }
      ], 
      onError: (err: any) => {
        console.error(err);
      },
    } as SocialAuthServiceConfig,
  },
  ],

where plugin_name must be the name you provided for your project in the google oauth api.

Hope this can help someone in need :)

This worked for me,Thanks!

pradosh05 commented 2 years ago

Hey, I found a solution that worked for me. Inside app.module.ts you have to add the following code in your providers:

providers: [
        {
          id: GoogleLoginProvider.PROVIDER_ID,
          provider: new GoogleLoginProvider(
            'clientId', {
              scope: 'email',
              plugin_name: 'login-app'
            }),
        }
      ], 
      onError: (err: any) => {
        console.error(err);
      },
    } as SocialAuthServiceConfig,
  },
  ],

where plugin_name must be the name you provided for your project in the google oauth api.

Hope this can help someone in need :)

Thank you so much, Its working for me too @davidmr163

veeravetrivel commented 2 years ago

What should be given in plugin_name? Google project name right?

franlaraa commented 2 years ago

What should be given in plugin_name? Google project name right?

Yes.

veeravetrivel commented 2 years ago

But this error {"error":"popup_closed_by_user"} occurs rarely for some of the google users account. Cant able to solve this permanently.

jviaches commented 2 years ago

Worked for me as well, huge thanks !

Heatmanofurioso commented 2 years ago

I'm closing this issue so this gets discussed in a single thread, also since the other one is the oldest and the most active thread on this whole discussion.

The thread is in https://github.com/abacritt/angularx-social-login/issues/489

And the current PR in which we're trying to address the issue is https://github.com/abacritt/angularx-social-login/pull/507

jayna456 commented 1 year ago

@davidmr163, by passing the second parameter, I am getting Expected 1 arguments, but got 2. Can you help me in this?

jayna456 commented 1 year ago

I tried to implement everything from scratch using only Google`s JS API library and got the same error. So basically @abacritt/angularx-social-login has nothing to do with it.

There is a thread with lots of suggestions how to fix the problem but none of them worked for me: https://stackoverflow.com/questions/48683320/google-sso-login-error-popup-closed-by-user

The only workaround I found so far is to use redirect instead of opening Google`s login screen in a separate window:

 providers: [{
            id: GoogleLoginProvider.PROVIDER_ID,
            provider: new GoogleLoginProvider(
              'clientId',
              {
                  scope: 'email',
                  ux_mode: 'redirect'
              }
            )
          }]

And then extract 'id_token' from query parameters in url.

By applying second parameter, I am getting Expected 1 arguments, but got 2.

Please help me out!