Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing message on SAP NetWeaver login screen ?

tim_alsop
Active Contributor
0 Kudos

We have configured the ticket auth stack in a SAP NetWeaver JAVA Instance so that SPNEGO auth is used first and if this fails, then BasicPasswordLoginModule is used afterwards. This allows domain users to get SSO experience, and users who are not logged onto a domain to get a browser form based login screen instead where they can enter a valid userid and password into browser.

The problem we have is that when the fallback to the BasicPasswordLoginModule occurs the first message shown is "User authentication failed" which is confusing for most users. We assume that this message is shown because the previous authetnication attempt (using SPNEGO) failed. So, is there a way to stop this message appearing on first login attempt,but still make it appear if the user enters something wrong into login form such as wrong password ?

Thanks,

Tim

9 REPLIES 9

Former Member
0 Kudos

Hi,

Hope this article helps you:

http://help.sap.com/saphelp_nwce10/helpdata/en/23/c0e240beb0702ae10000000a155106/content.htm

Detailed steps (These steps are copied from a third party website):

Here are some simple steps to follow to customize your very own SAP Enterprise Portal Login Page.

The login page is part of the par file with the name com.sap.portal.runtime.logon.par

1) Copy the file with the above name from the following location (EP6 SP9 and higher). It has the additional ending ".bak", which you should remove on you local copy :

j2eeclusterserver<#>appssap.comirjservlet_jspirj ootWEB-INFdeploymentpcd

2) Import the PAR file into Netweaver Developer Studio:

- Select File>Import .

- Choose the option PAR file. Select Next and a popup window appears.

- In the window you have 3 text fields: The location of the par file, a project name (which will also be the new par file name) and the location where the project should be saved. The project name should differ from the original SAP file to avoid overwriting of the original. It also works as a security blanket, in case you have an exception in your custom logon code or want to start from scratch again.

3) Check, that you have the following 2 JAR files under the subfolder /lib :

1. com.sap.portal.runtime.logon_api.jar

2. umelogonbase.jar

If you don't have these file, you will see a portal exception on the Logon page and the log file will have the entry:

Caused by: com.sapportals.portal.prt.core.broker.PortalComponentInstantiationException: Could not instantiate implementation class com.sapportals.portal.ume.component.logon.SAPMLogonCertComponent of Portal Component my.new.logon.certlogon because: Could not find implementation class

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal...

The files you need are located in the original PAR file. Just open it with a Unzip Program and copy the files in your project.

Now you have your project prepared and you are ready for making changes.

The most important files for a customization are:

- images, which are stored under distlayout

- JSP files, which are stored under distPORTAL-INF

All JSP pages include 3 additional files: The header (umLogonTopArea.txt), the bottom (umBotArea.txt) files, as well as the logon_proxy.txt .

Logon structure

The different pages in the Logon Par file are

Logon page : umLogonPage.jsp

Problem page : umLogonProblemPage.jsp

Help page (PW reset) : umHelpPage.jsp

Reset Password : umResetPasswordPage.jsp

Change Password Page: changePasswordPage.jsp

Certificate Logon : umLogonCertPage.jsp

Now enough about what elements we have. Let's customize ! But first make sure that you upload the new par-file, customize the authschemes.xml and restart the portal.

Changing Text

The text seen on the logon page is not in the JSP page, but in properties files which are called by tags like the Welcome text : <%=logonLocale.get("xtit_WELCOME")%>

In order to change "Welcome" to "Welcome to MyHR" you have to :

- Unzip the file umelogonbase.jar which you can find under distPORTAL-INFlib

- Find the file "logonLabels_" which contains your language;

e.g. for german logonLabels_de.properties,

for russian logonLabels_ru.properties or

for English logonLabels_en.properties

The default is in the file logonLabels.properties .

- Find the key which is used in the tag (here it is xtit_WELCOME) and change the text after the equal sign.

- Save the changed file and create a updated JAR file using a zip program. The file needs to be named umelogonbase.jar, not umelogonbase.zip or umelogonbase.jar.zip.

- Put the JAR file back to distPORTAL-INFlib.

Remove Support and Register links

The links are controlled with the UM settings

ume.logon.logon_help

ume.logon.selfreg

You could also just comment out the lines...

Change/add images

To exchange the two images, which are by default on the logon page, do the following steps:

  • Copy the image(s) you want to use in your project in the the folder dist/layout.

  • Find the < img src="" > you want to work on in the umBotArea.txt

  • Change the src attribute in the img tag to src="<%=webpath + "layout/myPic.gif" %>". The webpath is already defined in the file logon_proxy.txt and ready to use.

In the Netweaver portal 6.0 SP9 and higher you have 2 images on the right side.

Add a Document (e.g. Intro or FAQ)

You can add a document link to the logon page, which points to a KM document. Updating the Logon Document would then involve no transports,and if wanted an approval process. Less paperwork to worry....

1. Setup a folder Logon, e.g. under Public Documents and put in there the document you want to point to.

2. Setup the folder with Read access for the Anonymous Users group.

3. Create a KM Document iview and choose Anonymous as access, but don¡¦t change the path to the document yet.

4. Preview the document and note down the URL of this page (In most browsers Right-click outside the image and select Properties to get the URL).

5. In the iview add now the KM path an d preview it again to make sure that the path is correct.

6. In the logon page, create a link. The href value is the URL you noted down but starting with /irj and without the portal server name and port (otherwise you have to change it after every transport).

To spin this idea further you could show an XML form by putting that into an IFrame.

Dynamic Images and Links

I want to archive a Logon page that looks different for different user. The final PAR file should also work through the DEV, QUA (and sometimes Staging STG ) and PRD without changes in the code. The user will access the portal in all cases via different URLs. Hence we have to check the Request URL which can be accessed in a Java Servlet . In the code below we look in which system we are:

<% String url = componentRequest.getServletRequest().getRequestURL().toString(); if (url.indexOf("portal-e.")!= -1){... } else if (url.indexOf("portal-d.")!= -1){... } else if (url.indexOf("portal-q.")!= -1){...} else if (url.indexOf("portal.")!= -1) {...} else{...} %>

Another idea is to have different views depending from which URL you are coming.

Using that URL, you could have your Multi-Tenant portal without waiting to NW 2004s.

Accepting a Policy with the first Logon

A problem somebody had in the forum was, that a brandnew user should be redirected the first time to a Policy iview, where the user has to accept the policy.

After the acceptance the iview should not appear anymore. The solution was to add an new attribute field in the User Profile

See : http://help.sap.com/saphelp_nw04/helpdata/en/a3/d2ffd64602c149949ca3cf379dc295/content.htm

Authschemes.xml

I have now the new par file, but to have the portal reference on this PAR file, we need to customize and upload the customized authschemes.xml file through the Config-Tool of SAP WebAS.

When you edit the file, you should download the file to a local directory, edit it, and when uploading the edited file, create a new node in the configuration tree for it. In this way you do not loose the original version of the file.

1. Start the Config Tool by executing j2eeconfigtoolconfigtool.bat.

2. Navigate to cluster_data>server>persistent>com.sap.security.core.ume.service.

3. Switch to edit mode by clicking on the pencil which is at the upper right area.

4. In the tree, select authschemes.xml and choose Download. Save the file to your local directory

5. Edit the local file: To select the new PAR file as the Logon page change the occurrence of all substrings com.sap.portal.runtime.logon to your

project/PAR file name. All com.sap.portal.runtime.logon should be substituted with something like com.company.portal.runtime.logon (or whatever you project name is). Donu2019t remove the part behind it.

(These are the profiles in the portalapp.xml and have the names default, certlogon, basicauthentication, header, and anonymous).

6. Create a new node in the configuration tree in the Config-Tool for the edited file as follows:

a.Select the node com.sap.security.core.ume.service.

b. Choose the symbol for Creating a node below the selected node.

c. Select the type File-entry.

d. Choose Upload and select the custom file from your local directory.

e. Enter a name for the entry, for example, authschemes_myHR.xml. By default, the name of the uploaded file is used.

f. Choose Create.

g. Choose u201CClose windowu201D.

h. The new node appears in the configuration tree.

i. Go to Global server configuration>services> com.sap.security.core.ume.service and edit the property login.authschemes.definition.file.

The value needs to be changed from authschemes.xml to authschemes_myHR.xml

j. Restart the Portal.

Rgds,

Raghu

0 Kudos

Thanks for the blog. I think SAP should at least add comments in the JSPs to make it more user friendly

0 Kudos

Hello all!

Thanks for the blog! Lots of steps just in order to change a message....

But what I realy want to know is: How can I add/implement a new message!?

My customer wants to have a message while the payroll-run is active.

Is there anybody  who can tell me how to add the new message?

Thanks

Martin

0 Kudos

Hi Martin,

as the login application is an application, you can react on information in your backend and different content by means of application logic. To get an idea, please have a look a at the section on

'Dynamic Images and Links' in the post for Guest above.

BTW: for new questions, it might better to create a new thread.

Regards,

Patrick

0 Kudos

Hello Patrick,

a few month ago I opened a new thread with this problem - but there was no response....

I had a look at the section 'Dynamic Images and Links' but the problem is different and more complicated.

What I want to do is: A RFC to the backend to find out the payroll-state. But I don´t know where to code it into.

I know there are the logonLabels_de.properties files in the lib-folder where I can change the messages. In this file I would like to create a new variable with a new message-text like "payroll is running - please login later!".

Is it possible to talk in german via email? I think you can see my email-adress.

Greetings from Hamburg to Walldorf!

Martin

0 Kudos

Hi Martin,

I can not access your e-mail as you did set it to private.

Also I would suggest to not do an RFC from withtin the logon servlet. Either create a service on the system, allowing to change the parameter, which is called by the backend or if this is not feasible poll the payroll system on a regular basis.

I'm not sure, I do understand why you say, the dynamic solution from above does not fit. Essentially you need to modify the logon.jsp fle to check for the setting (as said, I would suggest not to do this via RFC but checking some info on the JAVA system reflecting the state) and then depending on this info render the appropriate text into the page, swiitch pages, use different images and more.

regards,

Patrick

0 Kudos

Hello Patrick,

the logon-page is not the original site - it was changed years ago by collegues which are not here anymore.

You wrote: .... "checking some info on the JAVA system reflecting the state".

How do I reach the  JAVA system? I have colleagues who worked with JAVA and Eclipse - but no one knows how to work with NWDS (and it looks like it´s not working right - but all lights are green). I´ve got the SAP JA100, JA200 and JA300 documentation in front of me and made a certificate a few years ago.... but that doesn´t help.

In the logon.jsp there is this part of coding which shows the error-messages. It is embedded in html code:

<!-- display error message if there is one -->

    <% if ( error.getMessage() != null ) { %>

               ........

    

<td class="urTxtStd"><span class="urMsgBarImgError"><img height="12" width="12" src="<%=webpath%>css/common/1x1.gif"></span></td>

                  <td><span class="urTxtStd" tabindex="0"><%=EncodeHtmlTag.encode(logonMessage.print(error.getMessage()))%></span></td>

               .......

    <% } else { %>

        <!-- no error message, display placeholder -->

        <tr>

          <td colspan="2" height="24"></td>

        </tr>

    <% } %>

How can I ask for the state of the payroll and where do I have to place the message?

Nobody I know is able to fix this problem.... :-((

I´m looking for the option to show my email-address here in the portal....

regards

Martin

0 Kudos

Hello Patrick!

It looks like all the documentation I red is old or not appropriate to the NWDS that I use. For example this one here: http://help.sap.com/saphelp_nw04/helpdata/de/43/037446dcc721ace10000000a1553f6/frameset.htm

The lines below "Portal Service" don´t exist when I do the steps that are told before.

I think that the NWDS I use is not right adjusted - but who can tell me what to do or what to adjust?

Is there anybody out there who is really fit with NWDS?

Martin

Former Member
0 Kudos

Hi,

I would think there is something wrong with the login stack. Check the sufficient, required etc tags. You most probably find there is a small detail wrong.