Skip to Content

While I was browsing through the User Management Engine (UME) API, I came across a method which I can use to change a user’s password. I could make use of it to change my own password. Or for that matter make an application which I can assign to every user to change his/her own password. Right, there is a Change Password iView under Admin Interfaces, but in the later versions of Portal it has been replaced with a Webdynpro application wherein a user can change his entire profile. So if you would like to have only the Password iview you got to follow an SAP Note. But, what if you would like to change the look or enhance it. I’ve done that with a few more functionalities. One being Client side validation. The other being auto logout and redirection to the portal login page after the password has been changed.

I am going to use JSP DynPage as the technology as it has a scope for server event management. The first screen would have a welcome message, a password box for the user to enter his/her desired password and a button to execute the password change program. The second screen would display a message indicating the status i.e. whether the password has been changed successfully or not. I am using a bean to transfer the data across the 2 views.

 

The entire code; I have made available on Wiki -> Code Gallery whose link will be mentioned below:

 

1. Create the Project Structure

Before I start, the configurations I’m working on are SAP WebAS (Java) 7.0 SPS 09, EP 7.0, NWDS 7.0.06

In the NWDS, create a New Portal Application Project and name it com.mycomp.passwordchange. Within this, create a New Portal Application Object. Select the Template as JSP DynPage. Enter the Name “PasswordChange”, Location “Core”, Class Name “PasswordChange”, Package Name “com.mycomp”, JSP Filename “PasswordChange.jsp”. In the next step, choose the Option “Generate bean statements”, give it a name “PasswordBean” and the scope “Application”. Alternate click on the Pagelet folder and create another jsp file “Success.jsp”. With this we have the project structure created, and now we have to go in for the implementation.

Steps 2. to 6.

These steps consist of the rest of the implementation through code. They are available at Wiki -> Code Gallery. Placing entire blocks of code on the Blog editor is a mess (for some reason the textarea approach does’nt work). Another advantage of placing the program here is that it can be edited for the good.

Do follow this link:

 

https://wiki.sdn.sap.com/wiki/display/Snippets/Change+Password+Page

 

Screen Shots

a. The first view

image

b. Client side validation for wrong retyped password

image

c. Server side validation for password not meeting the requirements

image

d. On Change of Password and subsequent Log Off

image

To report this post you need to login first.

16 Comments

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

    1. Prem Mascarenhas Post author
      Hi Chris,

      Yes you can. But if you do that you get the old interfaces for all User management screens on account of an SAP Note you need to follow. This application just got a few new features and also you could customize the LAF in any way you want.

      (0) 
      1. Chris Bahr
        So to get the solution I suggested to work, you would need to change the user management back to the non-web dynpro iviews that were used pre-NW04s? I was unaware of that. Thanks for the info!
        (0) 
      2. Chris Bahr
        I was able to get the web dynpro user managment iview to work with the action “Manage_My_Password” if I used a delta link of the web dynpro proxy iview located at pcd:portal_content/com.sap.pct/admin.templates/iviews/com.sap.portal.umeEnduserWD
        (0) 
    2. Jan Laros
      This is actually interesting if the standard functionality is not functioning correctly. On the other hand, it might be the case that this uses the same connectivity to the user store. Correct?

      We currently have problems with the configuration of the standard solution that SAP offers. It uses the ´support´ link on the logon screen. An E-mail with the new password is correctly sent to the user requesting it, but somehow the password is not changed and the old password stays active. I have already opened a thread for this:

      /thread/493694 [original link is broken]

      Perhaps you guy´s can have a look at it…. Any help is highly appreciated. Thanks in advance!

      Best regards,

      Jan Laros

      (0) 
  1. Qiulai Wang
    I customized a change password page and deployed it to our portal based on this example.

    The new password was able to set correctly, but when the user tried to logon the same portal right after the password change through my page, the logon would ask the user to change password again by the logon change password page.

    I don’t want users to change password twice, has anybody seen the same issue and was able to solve it?

    Thanks,

    (0) 
  2. Khushboo Singhal
    First of all, thanks for nice contribution. I have implemented your code for providing a password change link. The code works fine and PAR also got deployed, but when i test this app. in portal and  set new password and click on “Set Password”, it shows “Your password may not be meeting the requirements. Please check the requirements”. All the time i am getting this error. Can you please guide me on this? i hve to get rid of this eror ASAP. please help.
    (0) 
  3. Prashant Verma
    Excellent blog. i tried implementing it into a JSPDynpage Component. However pwd change doesnt happen,also no error is reported. Portal UME get users from AS ABAP. dont know exactly whats going wrong here. Any pointers would be helpfull!

    Kind Regards
    Prashant

    (0) 
  4. J. de Voijs
    Great blog! but,I deployed the par and created an passwordchange iview, so far so good. When I change the password correctly I get an runtime error. In the default trace:  com.sapportals.portal.prt.runtime.PortalRuntimeException: iView not found: PasswordChange.Redirection

    I created also an redirection iview but nothing change still error. I don’t want to return to login screen after changing password. When I start the portal again the logon would ask the user to change password again by the logon change password page I don’t want that either.

    How to solve this?

    gr

    Joeri

    (0) 
    1. Prem Mascarenhas Post author
      You check your password setting in System Admin. I think you force users to change their passwords after first change.

      Also, you can give authentication scheme for the redirect component to anonymous. You will not get the authentciation error. If you do not want the redirection, you can just comment out the code for doing so.

      Then when you login again you can use the newly changed passwd

      (0) 

Leave a Reply