on 08-01-2011 2:55 PM
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?
Hello Cilvaring,
I have the same problem. Did you solved it? If so, you can send me a solution?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.