Skip to Content

Open XS Application with username and password as parameters

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"



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 29, 2014 at 10:40 AM

    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.

      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


    Add comment
    10|10000 characters needed characters exceeded

    • 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.