Examples of UserService


Examples of org.apache.syncope.common.services.UserService

        return userTO;
    }

    @Test
    public void selfRead() {
        UserService userService2 = setupCredentials(userService, UserService.class, "rossini", ADMIN_PWD);

        try {
            userService2.read(1L);
            fail();
        } catch (HttpClientErrorException e) {
            assertEquals(HttpStatus.FORBIDDEN, e.getStatusCode());
        } catch (AccessControlException e) {
            // Will be thrown by cxf service
            assertNotNull(e);
        }

        UserTO userTO = userService2.readSelf();
        assertEquals("rossini", userTO.getUsername());
    }
View Full Code Here

Examples of org.apache.syncope.common.services.UserService

        assertNotNull(taskTO);
        assertEquals(maxTaskExecutions, taskTO.getExecutions().size());

        // 3. verify password
        UserService userService1 = super.setupCredentials(userService, UserService.class, newUserTO.getUsername(),
                "password123");
        try {
            UserTO user = userService1.readSelf();
            assertNotNull(user);
        } catch (AccessControlException e) {
            fail("Credentials should be valid and not cause AccessControlException");
        }

        UserService userService2 = super.setupCredentials(userService, UserService.class, newUserTO.getUsername(),
                "passwordXX");
        try {
            userService2.readSelf();
            fail("Credentials are invalid, thus request should raise AccessControlException");
        } catch (AccessControlException e) {
            assertNotNull(e);
        }
        resetRestTemplate();
View Full Code Here

Examples of org.beangle.spring.testbean.UserService

    assertNotNull((UserDaoProvider) factory.getBean("userDaoProvider"));

    assertNotNull((UserLdapProvider) factory.getBean("userLdapProvider"));

    // userService
    UserService userService = (UserService) factory.getBean("userService");

    assertNotNull(userService);

    assertNotNull(userService.getSomeMap());

    assertEquals(userService.getProvider().getClass(), UserDaoProvider.class);

    // userLdapService
    UserService userLdapService = (UserService) factory.getBean("userLdapService");

    assertNotNull(userLdapService);

    assertEquals(UserLdapProvider.class, userLdapService.getProvider().getClass());
  }
View Full Code Here

Examples of org.beangle.spring.testbean.UserService

  }

  public void testOverride() {
    ApplicationContext factory = new ClassPathXmlApplicationContext("/context-config.xml");
    // userService
    UserService userService = (UserService) factory.getBean("userService");

    assertNotNull(userService);

    // unmerged map
    assertNotNull(userService.getSomeMap());

    assertEquals(1, userService.getSomeMap().size());

    assertEquals(userService.getSomeMap().get("string"), "override string");

    // merged list
    assertEquals(userService.getSomeList().size(), 3);

    // change class
    UserLdapProvider ldapProvider = (UserLdapProvider) factory.getBean("userLdapProvider");
    assertTrue(ldapProvider instanceof AdvancedUserLdapProvider);

    UserService userLdapService = (UserService) factory.getBean("userLdapService");
    assertNotNull(userLdapService);

    assertEquals(AdvancedUserLdapProvider.class, userLdapService.getProvider().getClass());

  }
View Full Code Here

Examples of org.brixcms.rmiserver.UserService

            throw new IllegalStateException(
                    "Could not find JackRabbit repository in spring context");
        }


        UserService users = (UserService) BeanFactoryUtils.beanOfTypeIncludingAncestors(context,
                UserService.class);
        if (repository == null) {
            throw new IllegalStateException(
                    "Could not find UserService implementation in spring context");
        }
View Full Code Here

Examples of org.codehaus.redback.rest.api.services.UserService

        return service;
    }

    protected UserService getUserService( String authzHeader )
    {
        UserService service =
            JAXRSClientFactory.create( "http://localhost:" + port + "/" + getRestServicesPath() + "/redbackServices/",
                                       UserService.class );

        // for debuging purpose
        WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 3000000L );
View Full Code Here

Examples of org.dedeler.template.service.UserService

          System.out.println("=====================================================");
          // Thanks: http://stackoverflow.com/a/8687676/878361
          ApplicationContext applicationContext = ((ContextRefreshedEvent) event).getApplicationContext();

          RoleService roleService = applicationContext.getBean(RoleService.class);
          UserService userService = applicationContext.getBean(UserService.class);
         
          Role role = new Role("ROLE_USER");

          User user = new User();
          user.setUsername("admin");
          user.setPassword("7lLEodyoRSvB9W6Rhjc+xfabU0ITmcdbjaW4MfARG5TOb/N7TeMxDB85j/HSm8t1h6pTrATIXySR+yQ5jMo39Q==");// admin
          user.setFirstName("Destan");
          user.setAuthorities(Arrays.asList(role));

          roleService.save(role);
          userService.save(user);

          initialized = true;
          System.out.println("----------------------------------------------------");
        }
        catch (Exception e) {
View Full Code Here

Examples of org.eclipse.egit.github.core.service.UserService

    Commit commit = new Commit();
    commit.setMessage(message);
    commit.setTree(tree);

        try {
            UserService userService = new UserService(service.getClient());
            User user = userService.getUser();

            CommitUser author = new CommitUser();
            author.setName(user.getName());
            author.setEmail(user.getEmail());
            author.setDate(new GregorianCalendar().getTime());
View Full Code Here

Examples of org.g4studio.system.admin.service.UserService

   */
  public ActionForward updateUserInfo(ActionMapping mapping, ActionForm form,
      HttpServletRequest request, HttpServletResponse response) throws Exception {
    BaseActionForm cForm = (BaseActionForm)form;
    UserInfoVo userInfoVo = getSessionContainer(request).getUserInfo();
    UserService service = (UserService)getService("userService");
    Dto indDto = cForm.getParamAsDto(request);
    Dto outDto = new BaseDto(G4Constants.TRUE);
    outDto.put("flag", G4Constants.SUCCESS);
    String password = CodeUtil.encryptBase64(indDto.getAsString("password2"), G4Constants.BASE64_KEY);
    if (password.equals(userInfoVo.getPassword())) {
      service.updateUserItem4IndexPage(indDto);
      outDto.put("flag", G4Constants.SUCCESS);
      userInfoVo.setPassword(CodeUtil.encryptBase64(indDto.getAsString("password1"), G4Constants.BASE64_KEY));
      getSessionContainer(request).setUserInfo(userInfoVo);
    }else {
      outDto.setSuccess(G4Constants.FALSE);
View Full Code Here

Examples of org.jayasoft.woj.portal.business.services.users.UserService

                        String login = f.getString(Params.RETRIEVE_PASSWORD.PARAMS.LOGIN);
                        String email = f.getString(Params.RETRIEVE_PASSWORD.PARAMS.EMAIL);
                        String type = request.getParameter(Params.RETRIEVE_PASSWORD.PARAMS.TYPE);
                       
                        request.removeAttribute(Params.RETRIEVE_PASSWORD.REQUEST.ERROR_KEY);
                        UserService us = ServiceFactory.getUserService();
                       
                        User u = null;
                        if (Params.RETRIEVE_PASSWORD.CONST.TYPE_LOGIN.equals(type)) {
                            if (!StringUtils.isBlank(login)) {
                                u = us.getUser(login);
                            } else {
                                addWOJMessages(request, RessourceBundleApplicationMessage.error("woj.retrieve-password.error.no.login", null));
                                return "account.retrieve-password.show";
                            }
                        } else if (Params.RETRIEVE_PASSWORD.CONST.TYPE_EMAIL.equals(type)) {
                            if (!StringUtils.isBlank(email)) {
                                u = us.getUserByEmail(email);
                            } else {
                                addWOJMessages(request, RessourceBundleApplicationMessage.error("woj.retrieve-password.error.no.email", null));
                                return "account.retrieve-password.show";
                            }
                        } else {
                            addWOJMessages(request, RessourceBundleApplicationMessage.error("woj.retrieve-password.error.no.type", null));
                            return "account.retrieve-password.show";
                        }
               
                        if (u==null) {
                            // no user found
                            addWOJMessages(request, RessourceBundleApplicationMessage.error("woj.retrieve-password.error.no.user.found", null));
                            return "account.retrieve-password.show";
                        }
                       
                        String newPassword = AlphaNumericalPassGenerator.INSTANCE.generate();
                        u.setPassword(ChecksumUtil.encodeAsString(ChecksumUtil.SHA_1, newPassword));
                       
                        LOGGER.debug("changing password for user " + u.getLogin() + "[" + newPassword + ":" + u.getPassword() + "]");
                        us.update(u);
                        Portal.getInstance().getMailService().asyncSendMail(Portal.getInstance().getMailFactory().createRetrievePasswordMail(u.getEmail(), u.getLogin(), newPassword));
                       
                        return null;
                    }
                }
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.