Package org.openengsb.core.api.security.service

Examples of org.openengsb.core.api.security.service.UserDataManager


    @Before
    public void setUp() throws Exception {
        ContextHolder.get().setCurrentContextId("foo");

        UserDataManager userManager = new UserManagerStub();
        userManager.createUser("testuser");
        userManager.setUserCredentials("testuser", "password", "password");

        userManager.setUserCredentials("testuser", "onetime-basecode", "90489");
        userManager.setUserCredentials("testuser", "onetime-counter", "2");

        UsernamePasswordServiceImpl authenticator1 = new UsernamePasswordServiceImpl();
        authenticator1.setUserManager(userManager);
        registerServiceAtLocation(authenticator1, "authenticator/password", AuthenticationDomain.class);
        passwordAuthenticator = authenticator1;
View Full Code Here


    }

    @Override
    public void run() {
        Filter filter = FilterUtils.makeFilter(UserDataManager.class, "(internal=true)");
        UserDataManager userManager = (UserDataManager) utilsService.getService(filter);

        if (!userManager.getUserList().isEmpty()) {
            return;
        }
        try {
            userManager.createUser("admin");
            userManager.createUser("user");
        } catch (UserExistsException e) {
            LOGGER.error("this should not happen... I just checked whether the userbase is empty", e);
            return;
        }
        try {
            userManager.setUserCredentials("admin", "password", "password");
            userManager.setUserCredentials("user", "password", "password");

            userManager.createPermissionSet("ROLE_ROOT", new RootPermission());
            userManager.addPermissionSetToUser("admin", "ROLE_ROOT");
            userManager.addPermissionSetToUser("user", "INDEX");
        } catch (PermissionSetAlreadyExistsException e) {
            LOGGER.error("this should not happen... I just checked whether the userbase is empty", e);
        }
    }
View Full Code Here

            }
            if (count++ > 100) {
                throw new IllegalStateException("security-manager was not set in time");
            }
        }
        UserDataManager userDataManager = getOsgiService(UserDataManager.class, "(internal=true)", 20000);
        count = 0;
        while (userDataManager.getUserList().isEmpty()) {
            LOGGER.warn("waiting for users to be initialized");
            waitasec();
            if (count++ > 100) {
                throw new IllegalStateException("user-data-initializer did not finish in time");
            }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        ContextHolder.get().setCurrentContextId("foo");

        UserDataManager userManager = new UserManagerStub();
        userManager.createUser("admin");
        userManager.setUserCredentials("admin", "password", "password");
        userManager.addPermissionToUser("admin", new RootPermission());

        userManager.createUser("testuser");

        AdminAccessConnector adminAccessConnector = new AdminAccessConnector();
        adminAccessConnector.setUserManager(userManager);

        registerServiceAtLocation(adminAccessConnector, "authorization/admin", AuthorizationDomain.class);
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.security.service.UserDataManager

Copyright © 2018 www.massapicom. 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.