cancel
Showing results for 
Search instead for 
Did you mean: 

Open XS Application with username and password as parameters

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Colleagues,

I have an XSJS service like "/xxx/scenarios/xxx/myservice.xsjs/". I am calling this service using jQuery,ajax() in my SAPUI5 based application - that requires HANA Login credentials.

Like opening any other browser with user credentials, Is it possible to pass these credentials (username and password) as parameters while calling this application and not open traditional "/sap/hana/xs/formLogin/token.xsjs" to logon dialog ?

Something like: "/xxx/scenarios/xxx/myservice.xsjs?username=SYSTEM&pass=qwerty"

Regards,

Archana

Accepted Solutions (0)

Answers (1)

Answers (1)

sreehari_vpillai
Active Contributor
0 Kudos


Hello Archana,

you can not mangle the credentials in the URL by the way . But th below code will enable you to login as you are expecting it to be.

$.ajax({
  url
: WEBSERVICE_URL,
  type
: "GET", //This is what you should chage
  username: "username", // Most SAP web services require credentials
  password
: "password"

});

copy paste from : how to pass credentials for a webservice using jquery ajax call? - Stack Overflow

Sreehari

Archana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Sreehari,

This does not work. Infact I found a workaround for the same.

Regards,

Archana

sreehari_vpillai
Active Contributor
0 Kudos

Oh great Archana . Please share the solution which helped you .


By the way, you are calling xsjs from your UI5 application. Where are you deploying the UI5 application ? If it is in same hana system, while opening the UI5 app itself, it will ask you for credentials and the same will be used to consume the xsjs service as well.

Sree