Skip to Content

Changing Hana Default Login Screen

Update Link is no more active

You must be Logged on to comment or reply to a post.
  • Hi there,

    I think this is a good first approach, I have copied it out and change the login form.

    However I have not found a way to redirect the user to my login page yet, since sap could just wipe sap package at any time to update their stuff, I don't think this is a good idea?

    If anyone found a setting somewhere that I can set to point to another package for login that will be great!

    • Hi Stefanus,

      If you want to redirect the user to custom login page there is another way out.

      We can first look at how sap checks for the user login.

      1.Ajax call to chjeck if the user is already logged in (CRSF Token)

      2.If not redirect to the login page and create token

      (The code can be found at the ui/app.controller page)

      The same thing we can re-write on the on init event of our application controller . Then redirect the user for login to a custom .html login page with the target location as parameters.

      On successful login you can redirect back.

      Both the cases you have to set the authentation type to null in .xsaccess file as you will  be manually handling it.

      • Hi Pinaki Patra

        Thank you for the reply. Below is a piece of code for checking the session from app controller. 

        I change the else statement to a URLHelper redirect. However when going to the landing page, it seems it will load the original login form before redirecting it to mine. Is there a better way of doing this?

        Many thanks, I appreciate it!


        checkSession: function() {

                var view = this.getView();

                var origin = this.getParameterByName("x-sap-origin-location");


                    url: "/sap/hana/xs/formLogin/checkSession.xsjs",

                    type: "GET",

                    data: origin !== null ? {

                        "x-sap-origin-location": decodeURIComponent(origin)

                    } : {},

                    success: function(resp) {

                        if (resp) {

                            if (resp["x-sap-origin-location-ok"] === false) {




                            if (resp.login === true) {


                            } else {


                            sap.m.URLHelper.redirect("MYLINK_HERE?x-sap-origin-location="+origin, false);






        • Hi Stefanus,

          I think if you can write the same piece of code in your ui5 application controller :  function onInit Event and then redirect to your custom login page.

          You have to set the security type to null in the .xsapp of your ui5 appilcation.

          • hello Pinaki Patra,

            I tried that, its the same thing. I suppose it is because we are handling the login page from the front end. That is why, no matter what, it will load the original login page before redirecting it to my login page.

            I'm surprised that we can't define this setting in xsengine.ini file or in some other file. So that the backend able to tell straight away which package to load.

            Yeah .xsaccess file is set to null since we want it to be accessible publicly. I have done that part.

  • Hi Pinaki,

    We have followed the steps that are specified in the above document, but while changing any code in resource file to change the text on the Logon screen and running the application it is displaying logon page as a blank page.

    Kindly suggest how the application to be run once the changes are done in the standard HANA logon screen.

    As this is a priority for us, your prior response is appreciated. Thanks in advance.

    Thanks and Regards,


  • Hi Pinaki,

    I have followed the steps that are specified in the above document but the question arises for me is:

    How to use default logon with custom login table that consists of custom users and their password.

    As this is a required to me for my application, your prior response is appreciated. Thanks in advance.

    Thanks and Regards,


    • So what you are telling is that the users in your table are not database users.

      In that case I am not sure about the possibility.

      I am not sure but i think the alternate solution would be to create hana restricted users  and maintain a log of that in your table.

      Thay way you can make good use of the hana authentecation  layer without much effort

  • But on Cleartrip there are no steps given to access API. I'm facing a little trouble in accessing and customizing the API.

    Could you provide me the link to access its API.

    • Hi , I would recommend you start a new discussion for he same.

      The clear-trip API is a public API and you can debug their website to view the api's used.

  • Hi,

    Currently, we use SAML SSO to our SAP HANA XS with our ADFS. Is it possible to redirect to a logon page if user has no access to ADFS but has access in SAP HANA? If it is possible, can you please help me on how to do it?

    Thanks a lot.