UAKProvider uakProvider = (UAKProvider)request.getAttribute(Params.GENERAL.REQUEST.USER_UAK_PROVIDER);
if (uakProvider==null) {
ServerServicesProvider userSSP = ServerServicesProvider.get(Portal.getInstance().getMasterServer());
UnifiedAuthentificationService uas = new UnifiedAuthentificationService();
uas.setAuthentificationServer(Portal.getInstance().getMasterServer());
uas.setLoginInfo(userLogged.getLogin(), userLogged.getPassword(), CommonSecurityHelper.BROWSER, true, Portal.getVersion());
HttpAuthentificationService af = new HttpAuthentificationService();
af.setServer(new SimpleTargetServerProvider(Portal.getInstance().getMasterServer()));
af.setUnifiedAuthService(uas);
af.setSsp(userSSP);
UAK u = null;
try {
Authentification a = af.authenticate(userLogged.getLogin(), userLogged.getPassword(), CommonSecurityHelper.BROWSER, true, Portal.getInstance().getVersion());
if (a instanceof AuthSuccessfull) {
AuthSuccessfull au = (AuthSuccessfull)a;
u = au.getKey();
uas.setLoginInfo(userLogged.getLogin(), userLogged.getPassword(), CommonSecurityHelper.BROWSER, true, Portal.getVersion(), u.getUserId(), u.getGroups(), u.getPublishVisibilityRight());
uas.setUAK(u);
}
} catch (org.jayasoft.woj.common.services.ServiceException e) {
e.printStackTrace();
}