Skip to Content
0
Apr 01, 2015 at 07:43 AM

ODataModel Authentication Issue

240 Views

Hi Experts,

I am developing an SAP UI5 application where I am trying to connect to Gateway using the below constructor and function call.

oModel = new sap.ui.model.odata.ODataModel("https://host:port/sap/opu/odata/sap/service",

false, "Username", "Password");

OData.request({

requestUri: "https://host:port/sap/opu/odata/sap/service/...filter",

user:"Username", password:"Password",

method: "GET",

dataType: 'json',

headers:

{

"X-Requested-With": "XMLHttpRequest",

"Content-Type": "application/json; charset=utf-8",

"DataServiceVersion": "2.0",

"X-CSRF-Token":"Fetch"

}

},

function (resultdata, response){

successfun(resultdata, response);

},

function(err){

errorfunc(err);

});

When I close(exit) my browser and try to load the application, it prompts me authentication. But when I cancel it, and refresh the page, it is alright.

And also I maintained username & password in SICF transcation in Gateway system?

Can anyone please help? This seems ridiculous.

Thanks,

Ismail.