hanahana-xs

xsodata service without authentication


I am trying to create some xsodata services using SAP Hana XS Engine. I have created a .xsaccess file at global folder level which has the following content:

{
    "exposed": true,
    "authentication" : null
}

I have a services folder inside my parent folder where I have created a test service. The content of the service is

service namespace "example.services" {
    "TESTUSER1"."testdb" as "testdb";
}

But when I hit this url: /example/services/example.xsodata/testdb I get a 403 error. To verify if my .xsaccess if working fine, I created a dummy html file in the same folder as example.xsodata service. If I hit that link, it works fine and does not ask me any authentication.

To extend it further, I added .xsaccess file in services folder and added the same content as that mentioned above. It still gives 403 error to my example.xsodata service. To try this even further, I made the services/.xsaccess to have this content

{
    "exposed": true,
    "authentication" : [{"method":"Basic"}]
}

This prompted me for username/password and when i entered the values, it showed me the correct data as I expected.

I am utterly confused here because I want to make the services without authentication (for which i set authentication as null) and it is not working.

Please help me understand what am I missing here. Any help is really appreciable.


Solution

  • Answering my own question. Please follow this link from sap community network to get answer: http://scn.sap.com/thread/3496997