Base solution for your next web application
Open Closed

Google Social Login configuration #2607


User avatar
0
ivanosw1 created

Hi,

I'm not able to make google authentication work. I've configured oAuth2 url and redirect url to <a class="postlink" href="http://localhost:4200">http://localhost:4200</a> in console developer.

In console log after a successful login, I've this error: Uncaught TypeError: Cannot read property '_tokenAuthService' of undefined at webpackJsonp.1501.LoginService.googleLoginStatusChangeCallback (login.service.ts:260) at Function.<anonymous> (cb=gapi.loaded_0:154) at MessagePort.c.port1.onmessage (cb=gapi.loaded_0:72)

Any idea?

Thanks


6 Answer(s)
  • User Avatar
    0
    ivanosw1 created

    Hi, is there something not much clear in my question that nobody can answer ?

    How can I obtain support on this issue?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Your explanation is clear, no problem. We need to create the same scenario and try it before answering your question. Thanks for your patience.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Sorry again for the delay. Can you try to change this line

    gapi.auth2.getAuthInstance().isSignedIn.listen(this.googleLoginStatusChangeCallback);
    

    to this one

    gapi.auth2.getAuthInstance().isSignedIn.listen((isSignedIn) => {
        this.googleLoginStatusChangeCallback(isSignedIn);
    });
    

    Thanks.

  • User Avatar
    0
    ivanosw1 created

    Thanks for response.

    I've changed the code. The call flow is same as before but I can give you more informations:

    • On gapi.auth2.getAuthInstance().isSignedIn.listen((isSignedIn) , isSignedIn is true;
    • this._tokenAuthService is type of TokenAuthServiceProxy
    • post to <a class="postlink" href="http://localhost:22742/api/TokenAuth/ExternalAuthenticate">http://localhost:22742/api/TokenAuth/Ex ... thenticate</a> return http 500 and the server error is System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden). in System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() in Softwareuno.unoins.Web.Authentication.External.Google.GoogleAuthProviderApi.<GetUserInfo>d__1.MoveNext() in C:\Uno\Boilerplate\PhoneBook\aspnet-core\src\Softwareuno.unoins.Web.Core\Authentication\External\Google\GoogleAuthProviderApi.cs:riga 30

    I hope this can help you. Thanks

  • User Avatar
    0
    ivanosw1 created

    Ok guys. I got it.

    Sorry for my inexperience. I didn't know the Google+ API must be enabled on google api manager. Once enabled google auth works like a charm.

    Thank you so much.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Great :)