Examples of UserCredentials


Examples of org.hive2hive.core.security.UserCredentials

  private boolean register() throws NoPeerConnectionException, InvalidProcessStateException,
      InterruptedException {

    IUserManager userManager = menus.getNodeMenu().getNode().getUserManager();
    UserCredentials userCredentials = menus.getUserMenu().getUserCredentials();

    if (userManager.isRegistered(userCredentials.getUserId())) {
      return true;
    } else {
      H2HConsoleMenuItem
          .printPrecondition("You are not registered to the network. This will now happen automatically.");
      IProcessComponent registerProcess = userManager.register(userCredentials);
View Full Code Here

Examples of org.hive2hive.core.security.UserCredentials

  @Override
  protected void createItems() {
    CreateUserCredentials = new H2HConsoleMenuItem("Create User Credentials") {
      protected void execute() throws Exception {
        userCredentials = new UserCredentials(askUsedId(), askPassword(), askPin());
        exit();
      }
    };
  }
View Full Code Here

Examples of org.hive2hive.core.security.UserCredentials

    NetworkTestUtil.shutdownH2HNetwork(network);
  }

  @Test
  public void isRegisteredTest() throws NoPeerConnectionException, InterruptedException {
    UserCredentials userCredentials = NetworkTestUtil.generateRandomCredentials();
    String userId = userCredentials.getUserId();

    // all nodes must have same result: false
    for (int i = 0; i < network.size(); i++) {

      boolean isRegistered = network.get(i).getUserManager().isRegistered(userId);
View Full Code Here

Examples of org.hive2hive.core.security.UserCredentials

    // TODO test after unregistering
  }

  @Test
  public void isLoggedInTest() throws NoPeerConnectionException, InterruptedException, NoSessionException {
    UserCredentials userCredentials = NetworkTestUtil.generateRandomCredentials();
    String userId = userCredentials.getUserId();

    Path rootPah = FileTestUtil.getTempDirectory().toPath();

    // all nodes must have same result: false
    for (int i = 0; i < network.size(); i++) {
View Full Code Here

Examples of org.hive2hive.core.security.UserCredentials

    // random credentials
    String userName = NetworkTestUtil.randomString();
    String password = NetworkTestUtil.randomString();
    String pin = NetworkTestUtil.randomString();

    UserCredentials credentials1 = new UserCredentials(userName, password, pin);
    UserCredentials credentials2 = new UserCredentials(userName, password, pin);

    // test if same result twice
    Assert.assertEquals(credentials1.getProfileLocationKey(), credentials2.getProfileLocationKey());
  }
View Full Code Here

Examples of org.jboss.as.quickstarts.spring.model.UserCredentials

     * @return the view name
     */
    @RequestMapping(method = RequestMethod.GET)
    public String loginForm(Model model) {

        model.addAttribute(new UserCredentials());
        return "login";
    }
View Full Code Here

Examples of org.jivesoftware.openfire.sip.tester.security.UserCredentials

            // so that it appears as a default one next time user is prompted
            // for pass
            SIPConfig.setUserName(userName);
            SIPConfig.setAuthUserName(authUserName);

            UserCredentials initialCredentials = new UserCredentials();
            initialCredentials.setUserName(userName);
            initialCredentials.setAuthUserName(authUserName);
            initialCredentials.setPassword(password.toCharArray());

            register(initialCredentials.getUserName() + "@" + realm);

            // at this point a simple register request has been sent and the
            // global
            // from header in SipManager has been set to a valid value by the
            // RegisterProcesing
            // class. Use it to extract the valid user name that needs to be
            // cached by
            // the security manager together with the user provided password.

            initialCredentials.setUserName(((SipURI) getFromHeader()
                    .getAddress().getURI()).getUser());

            // JOptionPane.showMessageDialog(null,( (SipURI)
            // getFromHeader().getAddress().getURI()).getUser());
View Full Code Here

Examples of org.springframework.data.authentication.UserCredentials

    logger.info("MongoDB:");
    createService(VCAP_MONGO_SERVICE, "mongodb", "1.8");
    int tunnelPort = LOCAL_PORT + 2;
    createTunnelServer(VCAP_MONGO_SERVICE, tunnelPort);
    Mongo mongo = new Mongo(LOCAL_HOST, tunnelPort);
    MongoDbFactory mdbf = new SimpleMongoDbFactory(mongo, svc_dbname, new UserCredentials(svc_username, svc_passwd));
    MongoTemplate mongoTemplate = new MongoTemplate(mdbf);
    // Test data
    ObjectMapper objectMapper = new ObjectMapper();
    Map<String,Object> dataMap = null;
    try {
View Full Code Here

Examples of org.springframework.data.authentication.UserCredentials

    MongoDbFactory dbf = (MongoDbFactory) ctx.getBean("secondMongoDbFactory");

    Mongo mongo = (Mongo) getField(dbf, "mongo");
    assertEquals("localhost", mongo.getAddress().getHost());
    assertEquals(27017, mongo.getAddress().getPort());
    assertEquals(new UserCredentials("joe", "secret"), getField(dbf, "credentials"));
    assertEquals("database", getField(dbf, "databaseName"));
  }
View Full Code Here

Examples of org.springframework.data.authentication.UserCredentials

    MongoDbFactory dbf = (MongoDbFactory) ctx.getBean("thirdMongoDbFactory");
    Mongo mongo = (Mongo) getField(dbf, "mongo");

    assertEquals("localhost", mongo.getAddress().getHost());
    assertEquals(27017, mongo.getAddress().getPort());
    assertEquals(new UserCredentials("joe", "secret"), getField(dbf, "credentials"));
    assertEquals("database", getField(dbf, "databaseName"));
    assertEquals("admin", getField(dbf, "authenticationDatabaseName"));
  }
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.