Search code examples
javascriptangularjssatellizer

Satellizer providers login in Chrome browser, AngularJS


I have a problem with Satellizer and Google Chrome browser.

At first, I think I have implemented and configured well all the authorization providers, both with the corresponding redirectUri and with the API url that are dedicated to the authorization.

My problem is the following and it only happens to me with Google Chrome and is that 70% of the times I intend to log in with Facebook or Google, I get in console the following error:

Error: OAuth redirect has occurred but no query or hash parameters were > found. They were either set during the redirect, or were removed-typically by a routing library-before Satellizer could read it.

I also attached the configuration I have of the providers:

$authProvider.facebook({
    clientId : 'myFabecookClientId(already defined)',
    responseType: 'token',
    name: 'facebook',
    url: 'endPoint auth/facebook del API del backend',
    authorizationEndpoint: 'https://www.facebook.com/v2.5/dialog  /oauth',
    redirectUri: window.location.origin +'/',
    requiredUrlParams: ['display', 'scope'],
    scope: ['email'],
    scopeDelimiter: ',',
    display: 'popup',
    oauthType: '2.0',
    popupOptions: { width: 580, height: 400 }
});

$authProvider.google({
    clientId: 'myGoogleClientId(already defined)',
    responseType : 'code',
    name: 'google',
    url : 'Endpoint auth/google del API del backend',
    authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
    redirectUri : window.location.origin + ','
});

I have backend on a remote server running and the frontend in local since it has divided the work in two, in case it could affect in something.

It is curious, since in Firefox for example authorizes me without problems.


Solution

  • Try running frontend on remote (public) server instead of local server. Chrome may have some CORS issues