Examples of UAKProvider


Examples of org.jayasoft.woj.common.services.UAKProvider

        }

        return uakProvider.getUAK();
         */
       
        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();
            }
           
            final UAK uak = u;
            uakProvider = new UAKProvider() {
                public UAK getUAK() {
                    return uak;
                }
            };
           
            userSSP.setAutoLoginUAKProvider(uakProvider);
            request.getSession().setAttribute(Params.GENERAL.REQUEST.USER_UAK_PROVIDER, uakProvider);
            request.getSession().setAttribute(Params.GENERAL.REQUEST.USER_SSP, userSSP);
        }

        return uakProvider.getUAK();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.