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

**URL:** <https://community.auth0.com/t/getting-401-cross-origin-login-not-allowed-when-trying-to-authenticate-in-cordova-hybrid-ios-app/8181>\
**Category:** Get Help\
**Tags:** hybrid, cordova, login\
**Created:** [September 14, 2017, 12:34pm UTC](https://community.auth0.com/t/getting-401-cross-origin-login-not-allowed-when-trying-to-authenticate-in-cordova-hybrid-ios-app/8181 "2017-09-14T12:34:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel4](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@daniel4](https://community.auth0.com/u/daniel4)\
**Post date:** [September 14, 2017, 12:34pm UTC](https://community.auth0.com/t/getting-401-cross-origin-login-not-allowed-when-trying-to-authenticate-in-cordova-hybrid-ios-app/8181/1 "2017-09-14T12:34:54Z")

</div>

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 · GitHub](https://github.com/auth0/angular-auth0)), 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?

Thanks.

---

<div class="post-metadata">

**Author:** ![arcseldon](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/arcseldon/32/5933_2.png) [@arcseldon](https://community.auth0.com/u/arcseldon)\
**Post date:** [November 7, 2017, 7:42pm UTC](https://community.auth0.com/t/getting-401-cross-origin-login-not-allowed-when-trying-to-authenticate-in-cordova-hybrid-ios-app/8181/2 "2017-11-07T19:42:21Z")

</div>

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

![alt text][1]

---

<div class="post-metadata">

**Author:** ![daniel4](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@daniel4](https://community.auth0.com/u/daniel4)\
**Post date:** [November 19, 2017, 12:55pm UTC](https://community.auth0.com/t/getting-401-cross-origin-login-not-allowed-when-trying-to-authenticate-in-cordova-hybrid-ios-app/8181/3 "2017-11-19T12:55:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/getting-401-cross-origin-login-not-allowed-when-trying-to-authenticate-in-cordova-hybrid-ios-app/8181/4 "2018-03-02T05:56:28Z")

</div>


