I’m using angular2 app. Have been following the api documentation https://auth0.com/docs/api/authentication , singup, password change, custom login all work fine, except the social login progiders. I’m specifically using the Social authentication, google and facebook. From angular app I’m calling /authorize end point and I’m getting below error message
XMLHttpRequest cannot load Log into Facebook | Facebook. Redirect from ‘Log into Facebook | Facebook’ to ‘Log into Facebook | Facebook’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:5555’ is therefore not allowed access.
Here is my angular2 code
let url = ‘https://rmo.auth0.com/authorize?response_type=token&client_id=’ + Config.auth0ClientID +
‘&connection=’ + providerType + ‘&state=rmo-social-auth-csrf-token’;
return this.http.get(url)
.map(this.extractData)
.catch(this.handleError);
following the link https://auth0.com/forum/t/cors-with-authorization-endpoint/4389 I tried to navigate to the URL instead of making an http call as above, but still I get the same exact error message.
NOTE: if I use the lock0 js methods as below, social provider works fine. I have enabled my end points in CORS section of auth0 dashboard. So issue is not at on google side.
this.auth.login({
connection: providerType,
redirect: true,
popupOptions: {
width: 450,
height: 600
}
}));