cancel
Showing results for 
Search instead for 
Did you mean: 

xsodata service without authentication

Former Member
0 Kudos

I am trying to create some xsodata services. 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: <hostname:port>/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.

Accepted Solutions (1)

Accepted Solutions (1)

vivekbhoj
Active Contributor
0 Kudos

Hi Raghuveer,

The purpose of xsaccess file is that it enables you to specify who or what is authorized to access the content exposed by a SAP HANA XS application package and what content they are allowed to see.

If you want to use it without credentials, you will need to create a xssqlcc file

Check the below thread for your answer

SAP Hana Anonymous User? And HTTP POST method? | SAP HANA

And also read HANA Developer Guide, Section 3.5.3 for more info:

http://help.sap.com/hana/SAP_HANA_Developer_Guide_en.pdf

Regards,

Vivek

Former Member
0 Kudos

Thanks for the link. This is what I was missing

The final .xsaccess file may look something like this:

{

    "anonymous_connection": "yourpackage::anonuser",

    "authentication" : null,

    "exposed": true

}

Former Member
0 Kudos

Hello ,

I am using "SAP HANA Cloud Platform developer account"to create xsodata web services. Only I can access the xsodata web services. When my colleagues try to run the web service on their browser its giving below error.


{ "error": { "code": "", "message": { "lang": "en-US", "value": "Service exception: insufficient privilege."},"innererror":{"exception":"exception 1: no.71000258 (ptime\/query\/checker\/query_check.cc:2547)\n Not authorized\nNO exception throw location recorded. Stack generation suppressed.\n"}}


I have seen the post where  I need to update the "_SYS_XS"."SQL_CONNECTIONS" table. But I am not authorized to _SYS_XS"."SQL_CONNECTIONS" table in my trial version. How can I resolve this issue?


Please anyone can help me here.


Regards,Shanthal



Former Member
0 Kudos

Hi,

Refer to the below link to solve the privilege issue.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9063f922-81e2-3110-c9b9-b4b0c1199...

The table is created in _SYS_BIC Schema .

Create a hdbrole file with the below sql privileges and assign it to your user and then you would be able to access the xsodata service.

role p1940xxtrial.dev.perslist.roles::user

{

sql object p1940xxtrial.dev.perslist.data::mymodel.person: SELECT, INSERT, UPDATE, DELETE; application privilege: p1940xxtrial.dev.perslist::Basic;

}

call HCP.HCP_GRANT_ROLE_TO_USER('p1940xxtrial.dev.perslist.roles::user','p1940xx')

Hope this solves your issue.

Thanks

Former Member
0 Kudos

This message was moderated.

Answers (0)