Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

ODataModel constructor authentication not working?

$
0
0

Hi all,

 

I've ran into a small issue with my SAPUI5 code. I've created a very simple SAP NetWeaver Gateway service and I am able to test this via restclient (in chrome or via the application).

 

Now when I do the following in my sapui5 controller

 

 

showSecondPage: function() {
   var oAppData = sap.ui.getCore().getModel("app").getData();
   var oModel = new sap.ui.model.odata.ODataModel(oAppData.BaseURL, false, "user", "password");
  sap.ui.getCore().setModel(oModel);
   sap.ui.getCore().getEventBus().publish("nav", "to", {
        id : "ProductList"
    });
}

 

 

Then I get following error on chrome when testing it

Screen Shot 2013-12-18 at 09.57.54.png

 

In the developers tool (Network section) i see that the $metadata call is formatted this way:

<user>:<password>@server:port/sap/opu/odata/sap/<GW_SERVICE>/$metadata

And the response for this call is the login-form from SAP

 

 

The thing is when i open another tab in chrome and go manually to the metadata url and log in there it just works.

 

So did i forget to do something in my code to get through this loginform directly by the ODataModel constructor?

 

Thanks in advance.

 

Kind regards,

 

Robin


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>