Examples of UnifiedAuthentificationService


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

    public Authentification authenticate(String user, String password, String computerId, String clientVersion) throws ServiceException {
        return authenticate(user, password, computerId, false, clientVersion);
    }

    public Authentification authenticate() throws ServiceException {
        UnifiedAuthentificationService uas = getUnifiedAuthentificationService();
        return authenticate(uas.getUsername(), uas.getPassword(), uas.getComputerID(), uas.isPasswordEncrypted(), uas.getVersion());
    }
View Full Code Here

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

        UnifiedAuthentificationService uas = getUnifiedAuthentificationService();
        return authenticate(uas.getUsername(), uas.getPassword(), uas.getComputerID(), uas.isPasswordEncrypted(), uas.getVersion());
    }

    public UAK getUAK() {
        UnifiedAuthentificationService uas = getUnifiedAuthentificationService();
        if (uas.getUAK() == null && uas.getUsername() != null) {
            try {
                Authentification auth = authenticate();
                if (auth instanceof AuthFailed) {
                    AuthFailed authFailed = (AuthFailed)auth;
                    throw new IllegalArgumentException("authentication failed with: "+uas.getUsername()+": "+authFailed.getReasonMessage());
                }
            } catch (ServiceException e) {
                throw new RuntimeException("automatic authentification failed for "+uas.getUsername(), e);
            }
        }
        return uas.getUAK();
    }
View Full Code Here

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

        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();
            }
           
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.