This is the third blog in the series of Blogs which I am writing about Netweaver 7.3 Portal.
You can read the other two blogs here:
The idea for this blog came from these forum questions:
I have already written a blog about adding Logon Language option in Netweaver 7.0 using login module, which you can read here:
This blog tries to achieve the same functionality in Netweaver 7.3 Portal. It also discusses about how to port your logon module in Netweaver 7.3 as we don’t have a Library project option in Netweaver-7.3.
Before going ahead I will strongly recommend you to read the two blogs
Getting started with Netweaver 7.3 portal Part 2 – NWDS and Logon Page
Adding Logon Language option on Portal Logon Page
Throughout this blog I will be referring to the projects mentioned in the above two blogs.
The main steps to achieve our objective are:
- Import and adjust the Login Module in Netweaver 7.3
- Deploy the Login Module
- Configure the Login Module in NWA
- Enhance the Portal Logon Page to allow for Language Drop Down
Import the Login Module Projects in NWDS 7.3
As discusses in the Logon Language blog mentioned above, we have two projects CTSJAAS ( Java Project which has the logon module code) and CTSLogonModule (The Library project which defines the dependencies, configurations and acts as a wrapper to deploy the logon module).
1. In NWDS import the two projects into the workspace (Incase you just have the jar files and do not the project files you can just skip the import step)
2. You will notice that the CTSLogonModule (Library Project) is in error state, because the Library Project is not supported in Netweaver 7.3
3. Create an EAR Project (In My case it’s CTSLogonModuleEAR) and add dependency to the JAAS Project (In My case it’s CTSJAAS). This will add a reference to the CTSJAAS.jar in the EAR Project and the jar will be deployed along with the ear.
4. Create a XML file with the name LoginModuleConfiguration.xml in the folder META-INF. Please note that the name has to be LoginModuleConfiguration.xml for the engine to recognize the ear as login module.
Please refer to SAP Help link Managing Logon Modules for more details.
5. Now your project structure should look like below:
6. Edit the LoginModuleConfiguration.xml and add below mentioned code. Adjust according to your own class name.
7. Edit the application-j2ee-engine.xml and adjust accordingly. As you can notice we are adding references to the libraries here. We used to add this in provider.xml of the library project in NW 7.0. Also notice the difference in the use of reference tag in the two xml files.
Deploy the Login Module
I am assuming that you have maintained the SAP AS Java in NWDS and have required authorizations for deployment.
1. Export the SAP EAR file and store it inside the ear project.
2. In NWDS Go to Window->Show View->Other. Type Deploy View in filter criteria and select Deploy View
3. In Deploy View add CTSLogonModuleEAR to the list of Workspace Deployable archives.
4. In Deploy View right click on the archive and select Deploy.
5. After successful deployment NWDS will confirm that, archive has been deployed successfully.
Configure the Login Module
IMPORTANT: Please make sure that you have two sessions of Netweaver Administrator open either on two machines or in two different browsers.
With Visual administrator it was possible to revert the changes incase there is an error in Login Module. As there is no Visual Administrator in NW 7.3 and the changes need to be made through NWA, you won’t be able to login incase there is some error with your login module!!!!
1. login to http://<host>:<port>/nwa with a user which has got administrative rights.
2. Navigate to
Configuration Management->Security->Authentication and Single Sign-On
3. On the Login Modules Tab Select the Login Module which you want to Edit (If you haven’t modified the standard settings, it will be ticket)
4. Click on Edit and add your logon module (The name which you see here is the one configured in LoginModuleConfiguration.xml).
5. Adjust the flag and position of the Login module to suit your requirement. Refer to the logon module blog for details
6. Open a new session (Don’t close all the NWA sessions, keep at least one alive, you might need it). Aaccess the URL
7. You will get the login page (You won’t get the Language drop down as of now), Login to the portal and if your Login module is working you will see the content in German. Incase you get an error page on the logon screen itself read on
8. In my case I got an error screen saying that the class com.sap.engine.services.security.exceptions.BaseSecurityException is not found. This is one of the exceptions which are being used in our JAAS Implementation. I tried searching for this class in Netweaver 7.3, but couldn’t found it. In NW 7.0 this is located in sapj2eeclient.jar. I couldn’t find this jar file also in NW7.3. I was left with no other option but to include this jar in the ear project, which I don’t think, is the right way, and I hope someone reading this might suggest a better way. But this approach can be used incase you don’t have the JAAS project available with you and you need to include the jar file directly.
My Project structure now looks like
9. After regenerating and redeploying the ear, I was able to successfully test the Login Module.
Enhance the Portal Logon Page
I am assuming that you have followed the blog related to the Logon Page modification, and have all the projects already available in NWDS.
If you have worked on Logon screen modification in NW7.0, you will notice that there are major changes in NW7.3. As discussed in my blog on providing Language option in NW7.0, There used to be a property ume.logon.locale, which when set to TRUE through configtool will provide the Language Drop Down on the Logon Page. There is no such property in Netweaver 7.3. On analysing the Logon Page in NW7.0, I found out that the Languages appearing in the dropdown are store as properties files in umelogonbase.jar. The properties files are accessed through LanguagesBean. After doing a JAD (Java Decompilation), I found the code in Languages Bean to be pretty much independent of other logon functions. This gave me the idea to create my own Logon helper class which will provide the same functionality in NW 7.3. As a bonus I had the properties file which I extracted from the umelogonbase.jar and a template code for the helper class which got after doing the JAD on LanguagesBean class.
1. Create a Java project (In my case it’s LogonHelper), Create a class (In my case it’s LanguagesBean) which implements the interface Serializable.
2. Copy the properties files languages_xx.properties (which were extracted from the umelogonbase.jar) and place them inside the src folder of the Java project. Your project structure will look like below:
3. Copy and Paste the below code in LanguagesBean.java
4. Build the project and export the jar file. In my case it’s logonhelper.jar
5. Place the logonhelper.jar file inside the lib folder of tc~sec~ume~logon~ui project. Refer to the blog related with the logon page modification for details.
6. Open logonPage.jsp and include the LanguagesBean.
7. Include the below code in logonPage.jsp as shown
8. For reference I have attached the code for logonPage.jsp:
9. Refer to the blog related with the Logon Page modification to know how to dpeloy and adjust the configuration to use your custom logon page.
10. Restart the server after Deployment.
1. After restart, access the portal (http://<host>:<port>/irj). If everything is fine, you will see something like below:
2. Login to the Portal with your credentials, you should see something like below:
Congratulations!!!. You have Successfully Ported your login module to Netweaver 7.3 and added a new feature to the Login Page.