Getting 401 Cross origin login not allowed when trying to authenticate in Cordova hybrid iOS app

I am trying to integrate auth0 to my Cordova hybrid iOS app, trying to run it in simulator.

I am using the angular-auth0 thin wrapper from here (GitHub - auth0/angular-auth0: Angular 1.x Wrapper for Auth0.js v9 and higher), trying to follow the sample code on that page

Did include the auth0.auth0 module, init the angularAuth0 with my domain and client ID

Whitelist the callback URL to com.XXXXX.YYYYY://[domain]/cordova/com.XXXXXX.YYYYYY/callback

Set the CORS to file://*

In the controller,

        $scope.auth0.login(AUTH0_OPTIONS, function (err, result) {
            console.log("Error when trying to login : %o", err);
            console.log("Error result : %o", result);

When I hit the button to login, I am getting 401 with Cross origin login not allowed

{error: "unauthorized_client", error_description: "Cross origin login not allowed."}

in the log from auth0 web site

  "date": "2017-09-14T05:23:33.334Z",
  "type": "fco",
  "description": "Origin file:// is not allowed.",
  "date": "2017-09-14T05:23:33.335Z",
  "type": "fcoa",
  "description": "Cross origin login not allowed.",
  "connection_id": "",

Can someone please help me?


Make sure you have enabled this under `Client → Settings → Advanced → Oauth (tab)

![alt text][1]

When I enable the Cross Origin Authentication, it is asking me to enter a URL for Cross-Origin Verification Fallback with HTTPS scheme, but once again, I am doing a Cordova hybrid app, so HTTP doesn’t apply because it’s running an “app”, not a webpage.

Any idea?