Package com.atlassian.jira.rest.client.auth

Examples of com.atlassian.jira.rest.client.auth.BasicHttpAuthenticationHandler


  protected void setAdmin() {
    setClient(ADMIN_USERNAME, ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here


  }

  @Test
  public void testInvalidCredentials() {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(ADMIN_USERNAME, ADMIN_PASSWORD + "invalid"));
    TestUtil.assertErrorCode(401, new Runnable() {
      @Override
      public void run() {
        client.getSessionClient().getCurrentSession(new NullProgressMonitor());
      }
View Full Code Here

  public void testGetCurrentSession() throws Exception {
    final Session session = client.getSessionClient().getCurrentSession(new NullProgressMonitor());
    assertEquals(ADMIN_USERNAME, session.getUsername());

    // that is not a mistake - username and the password for this user is the same
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(TestConstants.USER1.getName(),
        TestConstants.USER1.getName()));
    final Session session2 = client.getSessionClient().getCurrentSession(new NullProgressMonitor());
    assertEquals(TestConstants.USER1.getName(), session2.getUsername());
    final DateTime lastFailedLoginDate = session2.getLoginInfo().getLastFailedLoginDate();

    final JerseyJiraRestClient client2 = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(TestConstants.USER1.getName(),
        "bad-password"));
    final DateTime now = new DateTime();
    TestUtil.assertErrorCode(401, new Runnable() {
      @Override
      public void run() {
View Full Code Here

        return new JerseyJiraRestClient(serverUri, authenticationHandler);
    }

  @Override
  public JiraRestClient createWithBasicHttpAuthentication(URI serverUri, String username, String password) {
    return create(serverUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

    setClient(TestConstants.ADMIN_USERNAME, TestConstants.ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

    setClient(TestConstants.ADMIN_USERNAME, TestConstants.ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

    private final OesbAsynchronousUserRestClient userRestClient;

    public RestJiraClient(URI serverUri, String username, String password) {
        final URI baseUri = UriBuilder.fromUri(serverUri).path("/rest/api/latest").build();
        final HttpClient httpClient =
            new AsynchronousHttpClientFactory().createClient(serverUri, new BasicHttpAuthenticationHandler(username,
                    password));
        jiraRestClient = new AsynchronousJiraRestClientFactory().create(serverUri, httpClient);
        userRestClient = new OesbAsynchronousUserRestClient(baseUri, httpClient);
    }
View Full Code Here

    return new AsynchronousJiraRestClient(serverUri, httpClient);
  }

  @Override
  public JiraRestClient createWithBasicHttpAuthentication(final URI serverUri, final String username, final String password) {
    return create(serverUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

    setClient(TestConstants.ADMIN_USERNAME, TestConstants.ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    final JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
    client = clientFactory.create(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

  protected void setAdmin() {
    setClient(ADMIN_USERNAME, ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.auth.BasicHttpAuthenticationHandler

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.