Skip to Content

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:

Getting started with Netweaver 7.3 portal Part 1-Installation

Getting started with Netweaver 7.3 portal Part 2 – NWDS and Logon Page

The idea for this blog came from these forum questions:

http://forums.sdn.sap.com/thread.jspa?threadID=2121130

http://forums.sdn.sap.com/thread.jspa?threadID=2118442

I have already written a blog about adding Logon Language option in Netweaver 7.0 using login module, which you can read here:

Adding Logon Language option on Portal Logon Page

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

img1.JPG

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.

img2.JPG

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:

img3.JPG

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.

img4.JPG

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.

img5.JPG

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

img7.JPG

6. Open a new session (Don’t close all the NWA sessions, keep at least one alive, you might need it). Aaccess the URL

http://<host>:<port>/irj/portal?ume.logon.locale=de

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

img8.JPG

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.3On 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:

img9.JPG

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

img10.JPG

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.

img11.JPG

6. Open logonPage.jsp and include the LanguagesBean.

img12.JPG

7. Include the below code in logonPage.jsp as shown

img13.JPG

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.

Eureka moment

1. After restart, access the portal (http://<host>:<port>/irj). If everything is fine, you will see something like below:

img14.JPG

2. Login to the Portal with your credentials, you should see something like below:

img15.JPG

Congratulations!!!. You have Successfully Ported your login module to Netweaver 7.3 and added a new feature to the Login Page.

To report this post you need to login first.

30 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member
    Hi Kumar,

    Nice blog and very detailed. From a performance perspective what is the impact of having such a LM for a large number of concurrent users?

    Cheers!!
    Kiran

    (0) 
    1. Kumar Prashant Post author
      Hi Kiran,

      Thanks for your comments. I haven’t experienced any considerable difference in performance for two reasons:

      1. I am changing the locale in the UME only if old locale is different from new locale. If you think about it most of the people will use a single locale  rather than changing it every time
      2. Whatever operations we are doing, we are doing for one particular user, and once the user gets authenticated it’s like normal portal session.

      Let me know incase you still have any concern.

      Thanks
      Prashant

      (0) 
  2. Former Member
    Nice explanation…
    One question… Along with the logon language, can we setup options where the employee can select how the decimals are displayed…

    Some (European) countries use a comma whereas in the US and other places, we use a period… Does the employee have an option to select how the data/numbers should be displayed?

    Regards,
    HS

    (0) 
    1. Kumar Prashant Post author
      Thanks Harshal,
      Regarding the formatting of Decimal points: Portal is just a window or Place holder for the applications. Portal will have no idea of the content which is being displayed.  All the formatting needs to be handled by the application itself.Just for example think, how portal will know what the website is displaying when you call an URL iview..?

      Hope it clarifies.

      Thanks
      Prashant

      (0) 
  3. Former Member

    Hi Prashant,

    Very nice blog and should be useful for many! And coming for my requirements, i’m actually looking for a way to customize the standard Logon Error Messages with Custom Error Messages (error message for each unsuccessful logon scenario by replacing the standard single message ‘User Authentication Failed’).

    As you’ve highlighted, the 7.3 Logon Module is not the same as 7.0. So could you let me know if this workable or not? If yes, how to achieve it?

    Thanks,

    MS

    (0) 
  4. prodyot sen

    Hi Prashant,

    Seeing your blog we have connfirmed our client about language thing on 7.3 ๐Ÿ™‚

    Need some clarification, we are trying to create cusom logon module as you have suggested, but not able to find all those jar files you have mentioned in our 7.3 environment.

    So, can you suggest the jar names in 7.3 that we need for this custom module and then logon par customization.

    It would be great if you kindly respond.

    Thanks,

    Sen

    (0) 
    1. Kumar Prashant Post author

      Hi Prodyot,

      I didn’t build the login module grounds-up for NW 7.3, I just migrated a NW 7.0 Login module to NW7.3. So in my case I didn’t make any explicit reference to the NW 7.3 Jar files.

      However it shouldn’t be very difficult to locate the relevant jar file in NW 7.3.

      Refer:

      http://scn.sap.com/community/netweaver-portal/blog/2012/08/21/locating-relevant-jar-files-when-migrating-custom-applications-to-sap-netweaver-portal-73

      http://scn.sap.com/docs/DOC-22884

      Regards

      Prashant

      (0) 
    2. Kumar Prashant Post author

      Hi Pradyot,

      I had some time today so I was able to build and test the login module for NW 7.3.

      Good news is you only need 3 jar files and all three are in the Eclipse plugin directory.

      1. com.sap.engine.clientapis_xxx.jar

      2. com.sap.security_xxx.jar

      3. sap.com~tc~logging~java~api.jar

      Tricky thing is to add the reference in application-j2ee-engine.xml.

      I am attaching my application-j2ee-engine.xml for reference.

      <?xml version=”1.0″ encoding=”UTF-8″?>

      <application-j2ee-engine xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”application-j2ee-engine.xsd”>

                <reference reference-type=”hard”>

                          <reference-target provider-name=”sap.com” target-type=”service”>tc~je~security~api</reference-target>

                </reference>

                <reference reference-type=”hard”>

                          <reference-target provider-name=”sap.com” target-type=”library”>tc~je~usermanagement~api</reference-target>

                </reference>

                          <reference reference-type=”hard”>

                          <reference-target provider-name=”sap.com” target-type=”library”>tc~bl~logging~api</reference-target>

                </reference>

      </application-j2ee-engine>

      Regards
      Prashant

      (0) 
      1. prodyot sen

        Hi Prashant,

        Thanks a lot for your response. This is really helpful for our start up. We would do as per your guidance and take your suggestion if we face any difficulty.

        Truly appreciate your response.

        Thanks,

        Sen

        (0) 
      2. prodyot sen

        Hi Prashant,

        We tried creating custom logon module. There is a problem.

        We have changed authentication in NWA as you have mentioned with our custom logon module.

        Now, when trying to login into portal to check whether this logon module is working or not using url –

        http://<host>:<port>/irj/portal?ume.logon.locale=de nothing is happening and after login language is coming as english.

        Now, when we goto log in NWA, there is shows requisit for the cusom logon module name corresponding to the user id.

        Is there anything related to do with permission or anything, so that logon module is not working.

        Can you suggest please.

        Thanks,

        Sen

        (0) 
        1. Kumar Prashant Post author

          Hi Prodyot,

          In my code I am setting the locale to the new locale only if it’s not blank initially.

          In User Adminidtration first set the User Language to something say English

          Incase it still doesn’t work, Look at the logs through NWA, it will tell you which login module is succeeding.

          Regards

          Prashant

          (0) 
          1. prodyot sen

            Hi Prashant,

            Our custom logon module is working perfectly. It worked after changing few lines in code as you had suggested.

            Thanks for your guidance. Really appreciate.

            Thanks,

            Sen

            (0) 
  5. Former Member

    Hi Prashant,

    First of all thanks for this wonderful blog.

    I have one new requirement with this language option.  User want to change the language of the logon  page itself  when selecting  any option from drop down(prior login).

    i.e. if user select German option from the language drop down, the logon page screen language  should be changed to German.

    Can you give me any idea how to implement that.

    Thanks & Regards,

    Sambaran

    (0) 
    1. Kumar Prashant Post author

      Hi Sambaran,

      Thanks.

      But why do you want to do it through the Drop Down..? If your users preferred language is say German (DE) and his Browser language is set as DE the logon page will automatically load in German.

      Regards

      Prashant

      (0) 
      1. Former Member

        Thank you Prashant.

        I know that language for logon screen will refer users browser language.

        But as we provide them the language drop down option to change the portal language after login. They want the same functionality on logon screen itself. So that logon screen language should change based on drop down selection.

        Its just users requirement and we are getting hard time to fulfill that.

        Any Idea how to achieve that!!

        Do you have idea of how logon component identify browser language/ default portal language / server language prior to login to portal.

        Thanks & Regards,

        Sambaran

        (0) 
        1. Kumar Prashant Post author

          Hi Sambaran,

          I am not convinced about the validity of the requirement, but still here is how you can achieve that:

          1. Write a Java script method which will execute when you select an option from the drop down.

          2. It will append ume.logon.locale=<locale> to the URL and refresh the page.

          3. After refresh your URL will look like http://<host&gt;:<port>/irj/portal?ume.logon.locale=de

          Regards

          Prashant

          (0) 
  6. Former Member

    Hi Kumar,

    Very informative blog. I ignored your suggestion of opening two nwa sessions and now I am just locked out. Is there a way to revert my custom login module to the default one using config tool, since I am not able to login to nwa? Your feedback is very much appreciated.

    Thanks

    Shaila

    (0) 
      1. Former Member

        Hello Prashant,

        Thanks for the document. I did follow this document but still it is using my custom login module and I am not able to login. Not sure if there is any other place I need to make the changes.

        Thanks

        Shaila

        (0) 
        1. Former Member

          Hello Prashant,

          I was able to revert to the default login module. Apart from the above document, I also made the change to ticket->security->authentication service to point to BasicLoginModule instead of the custom module. Thanks for your help.

          Regards

          Shaila

          (0) 
  7. Former Member

    Very informative Document.

    I have one question. My Portal is configured for Active Directory Multi-Domain authentication + Portal UME.

    How to add Domain selection dropdown  to the Login page?

    Regards

    Rajendra

    (0) 
  8. Former Member

    Hi Prashant,

    We are at EP7.3 and the error messages during password change are not user friendly, we need to change that , how can I do that?

    Also the reset password functionality of EP 7.3 takes us to webdynpro screen, can we use the resetPassword.jsp from war file to restore the functionality which was there in EP 7.0

    (0) 
        1. Former Member

          Well you’ve to use the UME Security API (com.sap.security.jar) for this requirement, you might need to work with IUser, IUserAccount, IUserFactory, IUserSearchFilter, ISearchResult classes.

          Refer to the below Java docs to see the methods:

          http://help.sap.com/javadocs/NW73/SPS08/CE/se/com.sap.se/com/sap/security/api/IUserAccount.html

          Also refer to the below PDF, page no: 28

          http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3641e490-0201-0010-c68f-e51221925714?QuickLink=events&overridelayout=true&5003637669624

          Hope these will help you to get started.

          Thanks, MS

          (0) 
          1. Former Member

            I don’t need complete custom messages, currently the error messages are showing like this:

            ABAP error.jpg

            Whereas We would need only the error message not the ABAP stack

            (0) 
  9. Former Member

    Hi Prasanth,

    Our requirement is Langauge option enables to the logon page portal.

    where can i get the Below the two projects

    1)CTSJAAS ( Java Project which has the logon module code) and

    2)CTSLogonModule (The Library project which defines the dependencies, configurations and acts as a wrapper to deploy the logon module).

    Thanks

    Srinivas

    (0) 
  10. Former Member

    Hello Prashant,

    Nice blog, by implementing this we can see the dropdown with the language list in 7.3 Logon page. Even after login to system respective languages text are visible. But when we change language from English to German and select Login button then existing text is still showing in English language as “German”(note we are not logged in yet), In our existing 7.0 environment German text is changed to their native language to “Deutsch” with all other options like English to “Englisch”. In our case in 7.3 only “Select” Option text is changed to German, as we are maintaining same in the properties file, remaining languages are still in English. Is there a way out by which we can update this on click of Login button so all text in dropdown will be changed to native language, as it is happening in existing 7.0 system?

    our Portal version is 7.3 SP13

    Thanks,

    Rajesh

    (0) 

Leave a Reply