Skip to Content

CORS Issue with Chrome

Hello Experts,

I am trying to invoke URL from my UI5 application using AJAX call, code is as follows :

onSearch : function (oEvent) {

var accessToken = "My Access Token";

var messageObject = {};
var that = this;
var baseUrl = "";
var sQuery = oEvent.getSource().getValue();
var sApiResSuccess;
var that=this;
var searchResult = this.getView().byId('productInput1');
    type: "POST",
    url: baseUrl + "query",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    crossDomain: true,
    headers: {
      "Authorization": "Bearer " + accessToken,
    data: JSON.stringify({query: sQuery, lang: "en", sessionId: "runbarry"}),
    success: function(data) {
    error: function() {

I have deployed this app on our gateway server and configured the same on our Fiori Launchpad. When I run the standalone BSP application on gateway server , it works fine , I am able to invoke ( , however , when I run the application through launchpad , it gives me CORS Issue , which is - field X-XHR-Logon is not allowed by Access-Control-Allow-Headers in preflight response.

I tried all possible options however not able to resolve this, could you please provide any inputs here ?

Hint : When I installed CORS extension of chrome and enabled it , it worked fine on my launchpad as well however I need to run this app on tablet browser where i can not add any extension.

Any help here would be highly appreciated.


Mahesh Z.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 09, 2017 at 01:09 PM

    You would want to add the service in gateway so all browser traffic is provided from gateway which would eliminate the error. See



    SAP - Technology RIG

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2017 at 02:48 PM

    Hello Mahesh,

    Jamie's solution will work for you and your scenario (FLP on ABAP gateway). If you want to understand in general why this error occurs you can have a look at the walkthrough tutorial step 26 (scroll down to the middle to find CORS):

    For the different scenarios (FLP on HCP, FLP on Portal and FLP on ABAP) similar solutions to proxy requests exist.

    Regards, Annette

    Add comment
    10|10000 characters needed characters exceeded