Examples of Credentials


Examples of javax.jcr.Credentials

            if (!contentSyncRoot.exists()) {
              throw new IllegalArgumentException("contentSyncRoot does not exist: "+contentSyncRoot);
            }

            Repository jcrRepo = RepositoryUtils.getRepository(repo.getRepositoryInfo());
            Credentials credentials = RepositoryUtils.getCredentials(repo.getRepositoryInfo());
           
            session = jcrRepo.login(credentials);

            RepositoryAddress address = RepositoryUtils.getRepositoryAddress(repo.getRepositoryInfo());
View Full Code Here

Examples of javax.jcr.Credentials

            info.getPassword());
    }

    @Test
    public void testSetCredentials() {
        final Credentials creds = new SimpleCredentials("user", new char[0]);
        final AuthenticationInfo info = new AuthenticationInfo("test");

        info.put(CREDENTIALS, creds);
        Assert.assertSame(creds, info.get(CREDENTIALS));
    }
View Full Code Here

Examples of javax.jcr.Credentials

        final AuthenticationInfo info = new AuthenticationInfo("test");

        assertNull(info.get(CREDENTIALS));
        assertFalse(info.containsKey(CREDENTIALS));

        final Credentials creds = new SimpleCredentials("user", new char[0]);
        info.put(CREDENTIALS, creds);

        assertSame(creds, info.get(CREDENTIALS));

        final String user = "user";
View Full Code Here

Examples of models.Credentials

        user.save();

        // Update credentials for the user (at login or password change)
        String provider = socialUser.identityId().providerId();
        Credentials credentials = null;
        for (Credentials creds : user.credentials) {
            if (creds.providerId.equals(provider)) {
                credentials = creds;
            }
        }

        if (credentials == null) {
            credentials = new Credentials();
        }

        credentials.extUserId = socialUser.identityId().userId();
        credentials.providerId = socialUser.identityId().providerId();

        if (socialUser.passwordInfo().isDefined()) {
            PasswordInfo pInfo = socialUser.passwordInfo().get();
            credentials.passwordHasher = pInfo.hasher();
            credentials.password = pInfo.password();
            if (pInfo.salt().isDefined()) {
                credentials.passwordSalt = pInfo.salt().get();
            }
        }

        if (socialUser.oAuth1Info().isDefined()) {
            OAuth1Info oAuth1 = socialUser.oAuth1Info().get();
            credentials.oAuth1Secret = oAuth1.secret();
            credentials.oAuth1Token = oAuth1.token();
        }

        if (socialUser.oAuth2Info().isDefined()) {
            OAuth2Info oAuth2 = socialUser.oAuth2Info().get();
            credentials.oAuth2AccessToken = oAuth2.accessToken();
            if (oAuth2.expiresIn().isDefined()) {
                credentials.oAuth2ExpiresIn = (Integer) oAuth2.expiresIn().get();
            }
            if (oAuth2.tokenType().isDefined()) {
                credentials.oAuth2TokenType = oAuth2.tokenType().get();
            }
            if (oAuth2.refreshToken().isDefined()) {
                credentials.oAuth2RefreshToken = oAuth2.refreshToken().get();
            }
        }
        credentials.user = user;
        credentials.save();

        return user;
    }
View Full Code Here

Examples of net.continuumsecurity.Credentials

  User alice;
  User admin;
 
  @Before
  public void setup() {
    bob = new User(new Credentials("username","bob","password","bobp"),"user");
    tom = new User(new Credentials("username","tom","password","tomp"),"user");
    alice = new User(new Credentials("username","alice", "password","alicep"),"user","admin");
    admin = new User(new Credentials("username","admin","password","adminp"),"admin");
    users = new Users();
    users.add(bob);
    users.add(tom);
    users.add(alice);
  }
View Full Code Here

Examples of org.ajoberstar.grgit.Credentials

   * @return {@code null} if both username and password are {@code null},
   * otherwise returns credentials in Grgit format.
   */
  public Credentials toGrgit() {
    if (username != null && password != null) {
      return new Credentials(username, password);
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.apache.accumulo.core.security.Credentials

    UtilWaitThread.sleep(30 * 1000);
    checkBalance(c);
  }

  private void checkBalance(Connector c) throws Exception {
    Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD));

    MasterMonitorInfo stats = null;
    int unassignedTablets = 1;
    for (int i = 0; unassignedTablets > 0 && i < 10; i++) {
      MasterClientService.Iface client = null;
      try {
        client = MasterClient.getConnectionWithRetry(c.getInstance());
        stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.getInstance()));
      } finally {
        if (client != null)
          MasterClient.close(client);
      }
      unassignedTablets = stats.getUnassignedTablets();
View Full Code Here

Examples of org.apache.commons.httpclient.Credentials

      IProxyData[] proxies = _proxyService.select(_uri);
      if (proxies != null && proxies.length > 0) {
        IProxyData proxy = proxies[0];
        getHostConfiguration().setProxy(proxy.getHost(), proxy.getPort());
        if (proxy.isRequiresAuthentication()) {
          Credentials credentials = new UsernamePasswordCredentials(proxy.getUserId(), proxy.getPassword());
          getState().setProxyCredentials(AuthScope.ANY, credentials);       
        } else {
          getState().setProxyCredentials(AuthScope.ANY, null);
        }
      } else {
View Full Code Here

Examples of org.apache.commons.httpclient.Credentials

      // gives an unauthorized response in certain situations, thus reducing the overhead of making the
      // connection.
      client.getState().setAuthenticationPreemptive(true);

      // Set up the WMS credentials:
      Credentials credentials = new UsernamePasswordCredentials(authentication.getUser(),
          authentication.getPassword());
      client.getState().setCredentials(authentication.getRealm(), parseDomain(url), credentials);
    }

    // Create the GET method with the correct URL:
View Full Code Here

Examples of org.apache.commons.httpclient.Credentials

        throws Exception
    {
        TestSuite suite = new TestSuite();

        HttpClient adminClient = new HttpClient();
        Credentials defaultcreds = new UsernamePasswordCredentials("Admin", "admin");
        adminClient.getState().setCredentials(AuthScope.ANY, defaultcreds);

        addXarFiles(validationTest, validator, suite, adminClient);
        addURLsForAdmin(validationTest, validator, suite, adminClient);
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.