cancel
Showing results for 
Search instead for 
Did you mean: 

Login iView

Former Member
0 Kudos

Hi Experts,

I want to build a custom Login iView and I have some problems when I enter the username and password I should be logged in directly.


String passW = request.getParameter("nPassword");
		String userN = request.getParameter("nUser");
		String Fehler = "Kein Fehler";
		int ValidPwd;
		
		HttpServletRequest req = request.getServletRequest();
		HttpServletResponse res = request.getServletResponse(true);
		
		
		
		
		try {
			IUserAccount userA = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userN); 
			ValidPwd = userA.checkPasswordExtended(passW);
			
			UMFactory.getUserFactory().invalidateCacheEntryByLogonId(userN);
			UMFactory.getUserAccountFactory().invalidateCacheEntryByLogonId(userN);
			
			ILogonAuthentication su = UMFactory.getLogonAuthenticator();
			su.logout(request.getServletRequest(), request.getServletResponse(false));
			req.setAttribute(ILoginConstants.LOGON_UID_ALIAS,userN);
			req.setAttribute(ILoginConstants.LOGON_PRINCIPAL_ID_ALIAS,passW);
			try {
				Subject sub = UMFactory.getLogonAuthenticator().logon(request.getServletRequest(), request.getServletResponse(false), "uidpwdlogon");
			} catch (LoginException e1) {
				e1.printStackTrace();
			}
			try {
				res.sendRedirect("/irj/portal?j_user=" + userN + "&j_password=" + passW);
			} catch (IOException e2) {
				e2.printStackTrace();
			}
					
		} catch (UMException e) {
			e.printStackTrace();
		} 
}
}

The login always fails.

I hinke I have to change something, but I have no idea

Can anyone help me?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Cilvaring,

I have the same problem. Did you solved it? If so, you can send me a solution?

Regards

former_member193379
Active Contributor
0 Kudos

Could you please mention that what exactly you want to achieve, as it is not clear.

Thanks,

Hamendra

Former Member
0 Kudos

Hi Hamendra,

i try to realize a portal logon with an EJB. The EJB should be reachable by by a webservice. In this example the logon() method expect an IPortalComponentRequest..getServletRequest(). I dont know how to create such a request and what it contains.

Best regards

Johannes

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

I think it would be good to know a little bit more about what is going on. I think you should have a stacktrace somewhere (e1.printStackTrace()). Would you mind posting it?