cancel
Showing results for 
Search instead for 
Did you mean: 

Remainder: How to customize reset password screen

Former Member
0 Kudos

Hi,

I am trying to customize reset password screen. I was trying to generate password on the same page itself by taking employee number , DOB and National ID as inputs instead of mailing to the person. This situation arises when the log on person will not have any email id. since i am new to this webdyn pro java stuff, i am unaware of how to proceed in this moment.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naga,

check this blog for password change screen:[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6920] [original link is broken] [original link is broken] [original link is broken];

hope it hlps u..

Regards,

Khushboo

Former Member
0 Kudos

The message is useful, but i want to change the existing page just to reset the password and display it in the same page. I have downloaded the com.sap.portal.runtime.logon.par file and tried to access the java classes so that i can change the existing coding, but in vain. The jsp pages can only change the UI, but what about giving the new password by resetting it in the same page? Can any one help me on this?

Former Member
0 Kudos

The message is useful, but i want to change the existing page just to reset the password and display it in the same page. I have downloaded the com.sap.portal.runtime.logon.par file and tried to access the java classes so that i can change the existing coding, but in vain. The jsp pages can only change the UI, but what about giving the new password by resetting it in the same page? Can any one help me on this?

former_member194668
Active Participant
0 Kudos

Hi,

You can do it... its a basic JSP coding mechanism.

In the JSP Form, declare a input type of hidden.

And check for this variable in initial.

If the value is null... that means you are coming for the first time. In that case dont process the form.

Else you process the form.

In the form submit try to redirect to the same page (reset password screen)

<FORM name="helpForm" method="post" action="/irj/servlet/prt/portal/prttarget/uidpwlogon/prteventname/HPFS/prtroot/com.sap.portal.navigation.portallauncher.default?helpActionPage=PASSWORD_RESET">

In the process you check for validation and provide the password there. you can generate the new password and display it...

IUserAccount account = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userid);
			String newPass = UMFactory.getSecurityPolicy().generatePassword();
			IUserAccount ua = UMFactory.getUserAccountFactory().getMutableUserAccount(account.getUniqueID());
			ua.setPassword(newPass);
			ua.save();
			ua.commit();

At any point of time, if you want to go back to logon page... you can do so by

httpResponse.sendRedirect(logonBean.getLogonURL(proxy, null));

Where logon bean is

<jsp:useBean id="logonBean" class="com.sap.security.core.sapmimp.logon.LogonBean" scope="session"/>

-Aarthi

Former Member
0 Kudos

Hi,

Thanks for your answer.

I want to create a seperate page for the person who doesn't have email id with his first name, last name, dob and employee number as inputs. If i am creating a seperate jsp as such inside the existing logon par, where should i map the name of jsp because i couldnt find any java files inside the par file i've downloaded from portal. Can i generate the password from the above inputs. Can you give me the detail code.

former_member194668
Active Participant
0 Kudos

Hi,

Check the umelogonbase.jar file inside the logon par file (after importing it to NWDS).

If you don't have search for it server installation direcotry and place it in /dist/PORTAL-INF/lib/

In that jar file(open with winzip), you can find one file logonPages.Properties.

There will be an entry like

umResetPasswordPage = /umResetPasswordPage.jsp

You have to create new jsp file , mention that jsp file in the above line, make a jar file again.

And replace the existing umelogonbase.jar with the new one.

But the problem is with overriding. If there is another component (or patch update), then it will override this jar file.

So it is advised to use the existing jsp file itself. Instead of creating new one.

Coming to the coding part...

What is the logon id that you are using to login to the portal?

email? or employee number?

I'll assume that you are using employee number...

With that you can get the details of the employee and compare it with entered first name, lastname and dob.

If all of them match, you can generate new password and show the password.

		try
		{		
			userid = userid.trim(); // assuming that employee number is the user id
			IUserFactory userFact = UMFactory.getUserFactory();
			IUser userFrom = userFact .getUserByLogonID(userid);
			if(	userFrom==null)	{
				// user doesn't exist handle that error
				return;
			} else if(!lastname.equalsIgnoreCase(userFrom.getLastName()))	{
				//lastname doesn't match				 
				return;
			} else if(!firstname.equalsIgnoreCase(userFrom.getFirstName()))	{
				// firstname doesn't match
				return;								
			}
			//dob is not a standard UME field. If you have your own custom field. try to get that one
			String dob = "";
			IUserMaint user = userFact.getMutableUser(userFact.getUserByLogonID(userid).getUniqueID());
			if(user!=null)	{
				String[] dob = user.getAttribute("<ur name space or null if not present>","<ur dob field>"); 
				for(int k=0;k<dob.length;k++)	{
					dob = secavals[k];
				}
			}
			if(	dob!=null && !dob.trim().equalsIgnoreCase("") && !dob.equals(<form field dob>)))	{
				//dob doesn't match
				return;
			}
			//here everything is matching and ready to generate new password
			IUserAccount account = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userid);
			String newPass = UMFactory.getSecurityPolicy().generatePassword();
			IUserAccount ua = UMFactory.getUserAccountFactory().getMutableUserAccount(account.getUniqueID());
			ua.setPassword(newPass);
			ua.save();
			ua.commit();
			//you can display newPass.
		}
		catch(Exception ex)
		{		
				if(ex.getMessage().indexOf("USER_AUTH_FAILED")>0)	{
					// user id not present		
				}
			//handle generic error.
			return;
		}

-Aarthi

Former Member
0 Kudos

I will not replace the existing url, but will create a new one. Where shall i place this code, coz it looks like the coding in a Java class. All i can access is JSP's.

former_member194668
Active Participant
0 Kudos

Either you can use a bean and use it in JSP or use scriptlets inside JSP.

-Aarthi

Former Member
0 Kudos

Hi,

I found out lot of instances for umelogonbase.jar. Which one shall i use? Is there a possibility of me changing wrong jar file and changes not getting effected inside the portal?

Former Member
0 Kudos

Hi..

hav a lokk at this thread also..:[;

Reagards,

Khushboo

Former Member
0 Kudos

Hi,

First and foremost thing, i've created a jsp page. Now i must link it from the first page, not on the existing link, but to create a new link and map the jsp to the link. Even after getting the umelogonbase.jar i need a servlet to map the jsp defined in logonpages.properties right. For example from userlogin page if i click on "Get Support" link the page will get forwarded "umHelp.jsp" with an alias name of "gotoHelpPage". The code written in link is as follows:

 <a class=urLnk href="<%=inPortal?proxy.getAlias("com.sap.portal.runtime.logon.certlogon",null):logonBean.getHttpsCertURL(proxy, null)%>">
                      <span class=urTxtStd><%=logonLocale.get("GOTO_CERT_LOGON_PAGE1")%></span>

Similarly from Help page the submit button will have action to go to "Password Reset Page" with an alias "HPFS"


 <input style="height:3ex;" class="urBtnStd" type="submit" NAME="submitHelpPage" VALUE="<%=logonLocale.get("SUBMIT")%>">
<FORM class="form" name="helpForm" method="post" action="<%=inPortal?proxy.getAlias("HPFS"):logonBean.getLogonURL(proxy, null) %>">

In the server installation directory there is work folder which contains "_sapportalsjsp_changePasswordPage.java" and "_sapportalsjsp_umLogonPage.java". Are they of some help?

Former Member
0 Kudos

Hi,

First and foremost thing, i've created a jsp page. Now i must link it from the first page, not on the existing link, but to create a new link and map the jsp to the link. Even after getting the umelogonbase.jar i need a servlet to map the jsp defined in logonpages.properties right. For example from userlogin page if i click on "Get Support" link the page will get forwarded "umHelp.jsp" with an alias name of "gotoHelpPage". The code written in link is as follows:

 <a class=urLnk href="<%=inPortal?proxy.getAlias("com.sap.portal.runtime.logon.certlogon",null):logonBean.getHttpsCertURL(proxy, null)%>">
                      <span class=urTxtStd><%=logonLocale.get("GOTO_CERT_LOGON_PAGE1")%></span>

Similarly from Help page the submit button will have action to go to "Password Reset Page" with an alias "HPFS"


 <input style="height:3ex;" class="urBtnStd" type="submit" NAME="submitHelpPage" VALUE="<%=logonLocale.get("SUBMIT")%>">
<FORM class="form" name="helpForm" method="post" action="<%=inPortal?proxy.getAlias("HPFS"):logonBean.getLogonURL(proxy, null) %>">

In the server installation directory there is work folder which contains "_sapportalsjsp_changePasswordPage.java" and "_sapportalsjsp_umLogonPage.java". Are they of some help?

Former Member
0 Kudos

Hi,

I am trying to customize reset password screen. I was trying to reset the password on a different page or jsp by taking employee number , DOB and National ID as inputs instead of mailing to the person. This situation arises when the log on person will not have any email id. The following fields should be input fields

1. Employee Personal Number

2. Date of Birth

3. National-ID

Once user fills in the details in the above fields and clicks the u201CSUBMITu201D button it will validate the database. Based on the Employee Personal number, DOB and National-ID has to be validated and will be given corresponding messages if they are invalid. If everything is valid, then password should be reset as user id and a message should be prompted as to change his password on his next log in. Can you throw some light.

Thanks

Tanuj.

Answers (0)