CORS | Request header field Authorization is not allowed by Access-Control-Allow-Headers ionic | IOS 13 preflight response


I have migrate my IOS ionic v1 app to IOS 13 and xcode 11.5. when I install the app and try to login first time then I am able to login successfully. But when I kill the app and try to open the app then it wont allow me to auto login. My service in deployed into IIS.

In the config.xml have added these settings

<preference name="WKSuspendInBackground" value="false" />
<preference name="iosScheme" value="httpsionic" />
<allow-navigation href="httpsionic://*" />
<allow-navigation href="http://localhost:8100/*" />

when i try to open the app after killing the app from task manager. it wont allow me to login. Its giving me an error

Request header field Authorization is not allowed by

First Time run when I install the app work as expected :-

enter image description here

after killing the app and open it again :-
enter image description here

this is the console log
enter image description here

Please let me know what I am missing something here so that access the app without this above CORS error.
this is my ionic info

   Ionic CLI         : 5.3.0
   Ionic Framework   : ionic1 1.2.4
   @ionic/v1-toolkit : 2.0.11

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-webview 5.0.0, (and 18 other plugins)

   cordova-res : not installed
   native-run  : 0.2.8 (update available: 1.0.0)

   ios-deploy : 1.9.0
   ios-sim    : 8.0.2
   NodeJS     : v10.16.3 (/usr/local/bin/node)
   npm        : 6.9.0
   OS         : macOS Catalina
   Xcode      : Xcode 11.5 Build version 11E608c


I did not get any solution for IIS

It might be helpful for someone how is facing this issue. So I have migrated my service to azure web apps. and all CORS issues are resolved using below command. In azure I am able to add Custom Origins after running these command from terminal.

To do this:

  1. Open Terminal in your Mac
  2. Run: /bin/bash -c "$(curl -fsSL"
  3. Once that is finished: brew update && brew install azure-cli
  4. Then login with your credentials by running: az login.  this will ask you to open a website to authorize your device
  5. Then run the azure CLI command for your specific app (this is an example of my app): az webapp cors add –allowed-origins
    ionic://***.com –name *** –resource-group ***


HOWTO install Azure CLI:
Configure CORS with Azure CLI:

Note :- Most welcome, if someone found the solution of IIS please post here add link for reference.

Answered By – Pritish

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published