Examples of addAuthentication()


Examples of org.apache.maven.artifact.ant.RemoteRepository.addAuthentication()

          public void execute(MavenDeployer deployer) {
            final RemoteRepository repository =  deployer.getRepository();
            if ( repository != null ) {
              final Authentication authentication = locateAuthenticationDetails( repository );
              if ( authentication != null ) {
                repository.addAuthentication( authentication );
              }
            }
            final RemoteRepository snapshotRepository = deployer.getSnapshotRepository();
            if ( snapshotRepository != null ) {
              final Authentication authentication = locateAuthenticationDetails( snapshotRepository );
View Full Code Here

Examples of org.apache.maven.artifact.ant.RemoteRepository.addAuthentication()

            }
            final RemoteRepository snapshotRepository = deployer.getSnapshotRepository();
            if ( snapshotRepository != null ) {
              final Authentication authentication = locateAuthenticationDetails( snapshotRepository );
              if ( authentication != null ) {
                snapshotRepository.addAuthentication( authentication );
              }
            }
          }
        }
    );
View Full Code Here

Examples of org.apache.maven.artifact.ant.RemoteRepository.addAuthentication()

        if (username != null || password != null) {
            Authentication authentication = new Authentication();
            authentication.setUserName(username);
            authentication.setPassword(password);
            remoteRepository.addAuthentication(authentication);
        }

        return remoteRepository;
    }
}
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

        HttpClient client = new HttpClient();

        try
        {
            AuthenticationStore authStore = client.getAuthenticationStore();
            authStore.addAuthentication(new DigestAuthentication(new URI(srvUrl), "test", "testuser", "password"));
            client.start();

            Request request = client.newRequest(srvUrl);
            request.method(HttpMethod.POST);
            request.content(new BytesContentProvider(__message.getBytes("UTF8")));
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

        String srvUrl = "http://127.0.0.1:" + ((NetworkConnector)_server.getConnectors()[0]).getLocalPort() + "/test/";      
        HttpClient client = new HttpClient();
        try
        {
            AuthenticationStore authStore = client.getAuthenticationStore();
            authStore.addAuthentication(new DigestAuthentication(new URI(srvUrl), "test", "testuser", "password"));  
            client.start();

            String sent = IO.toString(new FileInputStream("src/test/resources/message.txt"));
           
            Request request = client.newRequest(srvUrl);
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

        Assert.assertNotNull(response);
        Assert.assertEquals(401, response.getStatus());
        Assert.assertTrue(requests.get().await(5, TimeUnit.SECONDS));
        client.getRequestListeners().remove(requestListener);

        authenticationStore.addAuthentication(authentication);

        requests.set(new CountDownLatch(2));
        requestListener = new Request.Listener.Adapter()
        {
            @Override
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

        client.getRequestListeners().add(requestListener);

        AuthenticationStore authenticationStore = client.getAuthenticationStore();
        URI uri = URI.create(scheme + "://localhost:" + connector.getLocalPort());
        BasicAuthentication authentication = new BasicAuthentication(uri, realm, "basic", "basic");
        authenticationStore.addAuthentication(authentication);

        Request request = client.newRequest("localhost", connector.getLocalPort()).scheme(scheme).path("/secure");
        ContentResponse response = request.timeout(5, TimeUnit.SECONDS).send();
        Assert.assertNotNull(response);
        Assert.assertEquals(200, response.getStatus());
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

        startBasic(new EmptyServerHandler());

        AuthenticationStore authenticationStore = client.getAuthenticationStore();
        URI uri = URI.create(scheme + "://localhost:" + connector.getLocalPort());
        BasicAuthentication authentication = new BasicAuthentication(uri, realm, "basic", "wrong");
        authenticationStore.addAuthentication(authentication);

        Request request = client.newRequest("localhost", connector.getLocalPort()).scheme(scheme).path("/secure");
        ContentResponse response = request.timeout(5, TimeUnit.SECONDS).send();
        Assert.assertNotNull(response);
        Assert.assertEquals(401, response.getStatus());
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

         _client = new HttpClient();
         QueuedThreadPool executor = new QueuedThreadPool();
         executor.setName(executor.getName() + "-client");
         _client.setExecutor(executor);
         AuthenticationStore authStore = _client.getAuthenticationStore();
         authStore.addAuthentication(new BasicAuthentication(_baseUri, __realm, "jetty", "jetty"));
         _client.start();
     }

     protected void stopClient()
         throws Exception
View Full Code Here

Examples of org.eclipse.jetty.client.api.AuthenticationStore.addAuthentication()

         _client = new HttpClient();
         QueuedThreadPool executor = new QueuedThreadPool();
         executor.setName(executor.getName() + "-client");
         _client.setExecutor(executor);
         AuthenticationStore authStore = _client.getAuthenticationStore();
         authStore.addAuthentication(new BasicAuthentication(_baseUri, __realm, user, pwd));
         _client.start();
     }

     protected void stopClient() throws Exception
     {
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.