Examples of User


Examples of org.jboss.mobicents.seam.User

                invokeAction("#{identity.login}");
            }
            @Override
            protected void renderResponse() throws Exception {
                assert getValue("#{identity.loggedIn}").equals(Boolean.TRUE);
                User currentUser = (User) getValue("#{currentUser}");
                assert currentUser.getUserName().equals("user1");
            }
        }.run();      
       
    }
View Full Code Here

Examples of org.jboss.portal.identity.User

               "Posible data inconsistency");
         }
         SearchResult res = (SearchResult)sr.iterator().next();
         ctx = (Context)res.getObject();
         String dn = ctx.getNameInNamespace();
         User user = createUserInstance(res.getAttributes(), dn);
         ctx.close();
         return user;

      }
      catch (NoSuchElementException e)
View Full Code Here

Examples of org.jboss.resteasy.keystone.model.User

      newUser.setEnabled(true);
      Map creds = new HashMap();
      creds.put("password", "foobar");
      newUser.setCredentials(creds);
      Response response = admin.users().create(newUser);
      User user = response.readEntity(User.class);
      response = admin.roles().create("user");
      Role role = response.readEntity(Role.class);
      Projects projects = admin.projects().query("Skeleton Key");
      Project project = projects.getList().get(0);
      admin.projects().addUserRole(project.getId(), user.getId(), role.getId());

      admin = new SkeletonKeyClientBuilder().username("jsmith").password("foobar").idp(target).admin();
      response = admin.roles().create("error");
      Assert.assertEquals(403, response.getStatus());
      client.close();
View Full Code Here

Examples of org.jboss.resteasy.skeleton.key.idm.model.data.User

      }
      if (!realm.isEnabled())
      {
         return Response.ok("Realm not enabled").type("text/html").build();
      }
      User client = identityManager.getUser(realm, clientId);
      if (client == null)
      {
         logger.debug("client not found");
         throw new ForbiddenException();
      }
      if (!client.isEnabled())
      {
         return Response.ok("Requester not enabled").type("text/html").build();
      }


      String username = formData.getFirst("username");
      User user = identityManager.getUser(realm, username);
      if (user == null)
      {
         logger.debug("user not found");
         return loginForm("Not valid user", redirect, clientId, scopeParam, state, realm, client);
      }
      if (!user.isEnabled())
      {
         return Response.ok("Your account is not enabled").type("text/html").build();

      }
      boolean authenticated = authenticate(realm, user, formData);
View Full Code Here

Examples of org.jboss.seam.example.booking.User

      new FacesRequest() {
        
         @Override
         protected void invokeApplication()
         {
            Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
            setValue("#{identity.username}", "gavin");
            setValue("#{identity.password}", "foobar");           
            invokeMethod("#{identity.login}");
         }
        
View Full Code Here

Examples of org.jboss.seam.example.hibernate.User

      new FacesRequest() {
        
         @Override
         protected void invokeApplication() throws Exception
         {
            Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
            setValue("#{identity.username}", "gavin");
            setValue("#{identity.password}", "foobar");           
            invokeAction("#{identity.login}");
         }
        
View Full Code Here

Examples of org.jboss.seam.example.jpa.User

      new FacesRequest() {
        
         @Override
         protected void invokeApplication() throws Exception
         {
            Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
            setValue("#{identity.username}", "gavin");
            setValue("#{identity.password}", "foobar");           
            invokeAction("#{identity.login}");
         }
        
View Full Code Here

Examples of org.jboss.seam.example.spring.User

  public void testBooking() throws Exception {
    new FacesRequest() {

      @Override
      protected void invokeApplication() throws Exception {
        Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
        setValue("#{identity.username}", "gavin");
        setValue("#{identity.password}", "foobar");
        invokeAction("#{identity.login}");
      }
View Full Code Here

Examples of org.jboss.seam.examples.booking.model.User

    private final List<User> users = new ArrayList<User>();
    private final List<Hotel> hotels = new ArrayList<Hotel>();

    public ApplicationInitializer() {
        users.addAll(Arrays.asList(
                new User("Shane Bryzak", "shane", "shane@example.com", "brisbane"),
                new User("Dan Allen", "dan", "dan@example.com", "laurel"),
                new User("Lincoln Baxter III", "lincoln", "lincoln@example.com", "charlotte"),
                new User("Jose Freitas", "jose", "jose.freitas@example.com", "brazil")));

        hotels.addAll(Arrays.asList(
                new Hotel(129, 3, "Marriott Courtyard", "Tower Place, Buckhead", "Atlanta", "GA", "30305", "USA"),
                new Hotel(84, 4, "Doubletree Atlanta-Buckhead", "3342 Peachtree Road NE", "Atlanta", "GA", "30326", "USA"),
                new Hotel(289, 4, "W New York - Union Square", "201 Park Avenue South", "New York", "NY", "10003", "USA"),
View Full Code Here

Examples of org.jboss.seam.examples.seamcrm.user.User

        if (!Strings.isNullOrEmpty(credentials.getUsername())) {
            log.info("Authenticating: \"" + credentials.getUsername() + "\"");

            try {
                User u = em.createQuery("from User u join fetch u.contact where u.contact.emailAddress=:username", User.class)
                        .setParameter("username", credentials.getUsername()).getSingleResult();

                if (u != null) {
                    PasswordCredential password = (PasswordCredential) credentials.getCredential();
                    String hashedPassword = securityUtil.hash(u, password.getValue());
                    if (hashedPassword.equals(u.getPassword())) {
                        loginEvent.fire(u);
                        u.setDateLastLogin(new Date());
                        setUser(new SimpleUser(u.getContact().getEmailAddress()));
                        setStatus(AuthenticationStatus.SUCCESS);
                        eventLog.fire(new EventLog(u, "User Logged In"));
                    } else {
                        messages.info("Incorrect Password");
                        setStatus(AuthenticationStatus.FAILURE);
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.