Login Page For Custom Sapui5 Applications
Login Page For Custom Sapui5 Applications
Login Page For Custom Sapui5 Applications
blog I am sharing my experience with Login page requirements in SAP Fiori custom development. we have
created a SAPUI5 application and added it in Launch page ( Yes it is Launch page not Launchpad ). Things
were running great. Everything was fine as per the Fiori flow.
One day our client asked us to remove the middle interface of Tile Catalog from the flow. They wanted us to
bring the user directly on application view instead of Tile Catalog after successful Login.
They also wanted to change the Login page background and company logo.
For first requirement we thought of creating a custom login page and manage everything by calling methods of
standard login class or create a Z solution to mange login if possible. Now if we are doing so, we have to provide
a solution for Logoff also. I read many blogs related to login issues on SCN, so first decided to search on SCN
then take a call for the best suited solution. For me SCN is always the first choice to solve any problem related
For second requirement we searched on SCN and found that ”/UI2/SRA_LOGIN” class will handle everything
we just need to enhance the respective methods.
Meanwhile one of my colleague was reading the Extend SAP Fiori Applications
(https://help.sap.com/saphelp_fiori/fiori10_extend_en.pdf) guide and he found something by which we can
mange login page changes just by creating only a single properties file in our application. This was something
new for me. I have never found any blog on SCN regarding this and didn’t go through configuration guide till
the end . If you have any links related to Login screen enhancements using properties file, please share it
in comments.
Now moving to the solution we decided for our custom SAPUI5 Application,One of our team member who is
champ of sap portal , used his experience and gave a solution to use standard SAP Fiori login page for our
application without writing a single line of code or any custom login page. We manged the login page changes
as per the solution given in the extened guide. For Logoff, we created a button in our application to call the
logoff method of shell.
Steps followed:
Go to transaction SICF
Search for your service name (BSP Directory Name )
Here you can change the redirect URL on logoff ( When user press the logoff button in your application)
Now select the Logon Errors tab under same Errors Pages tab
Select the System Logon radio button at the bottom to let the system handle/generate the error pages
Click on the Configuration Button
Create a login. properties file as shown in below image and add it to your BSP directory or in your application Web
Content Folder. Please read more about Customizing Login Page
athttps://help.sap.com/saphelp_fiori/fiori10_extend_en.pdf ( 4.1 )
Requirement #3: Logoff button
We provided a logoff button in our application which triggers the logoff event of shell. Please see the code below.
new sap.m.Button("btnLogoff",
{icon:"sap-icon://log",
press:function()
{
var shell = sap.ui.getCore().byId("mainShell");
shell.attachLogout(function()
{
jQuery.ajax({url:"http://server:8000/sap/public/bc/icf/logoff",
async:false}).complete(function
(){location.reload();
});
});
shell.fireLogout();
}
})
If you have any suggestions or if you find something wrong in above blog, please share your comments.