Package org.glassfish.jersey.client.filter

Examples of org.glassfish.jersey.client.filter.HttpBasicAuthFilter


        this.useSsl = useSsl;
        client = ClientFactory.newClient();

        client.register(new CsrfProtectionFilter());
        if(user != null) {
            client.register(new HttpBasicAuthFilter(user, password));
        }
    }
View Full Code Here


        realClient = JerseyClientFactory.newClient();
        realClient.register(new MultiPartFeature());
        realClient.register(new JettisonFeature());
        realClient.register(new CsrfProtectionFilter());
        if ((userName != null) && (password != null)) {
            realClient.register(new HttpBasicAuthFilter(userName, password));
        }
        realClient.register(new ClientRequestFilter() {

            @Override
            public void filter(ClientRequestContext rc) throws IOException {
View Full Code Here

        // Make REST Request

        Client client2 = ClientFactory.newClient();
        RestUtil.initialize(client2);
        WebTarget target = client2.target(restURL);
        target.register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
        RestResponse restResp = RestResponse.getRestResponse(resp);
View Full Code Here

        // Make REST Request

        Client client2 = RestUtil.initialize(ClientBuilder.newBuilder()).build();
        WebTarget target = client2.target(restURL);
        target.register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
        RestResponse restResp = RestResponse.getRestResponse(resp);
View Full Code Here

        // Make REST Request

        Client client2 = ClientFactory.newClient();
        RestUtil.initialize(client2);
        WebTarget target = client2.target(restURL);
        target.configuration().register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
        RestResponse restResp = RestResponse.getRestResponse(resp);
View Full Code Here

        // Make REST Request

        Client client2 = ClientBuilder.newClient();
        RestUtil.initialize(client2);
        WebTarget target = client2.target(restURL);
        target.register(new HttpBasicAuthFilter(username, password));
        MultivaluedMap payLoad = new MultivaluedHashMap();
        payLoad.putSingle("remoteHostName", request.getRemoteHost());

        Response resp = target.request(RESPONSE_TYPE).post(Entity.entity(payLoad, MediaType.APPLICATION_FORM_URLENCODED), Response.class);
        RestResponse restResp = RestResponse.getRestResponse(resp);
View Full Code Here

                    logger.log(Level.FINER, "Using auth info: User: {0}, Password: {1}",
                            new Object[]{user, ok(password) ? "<non-null>" : "<null>"});
                }
                final AuthenticationInfo authInfo = authenticationInfo();
                if (authInfo != null) {
                    HttpBasicAuthFilter besicAuth = new HttpBasicAuthFilter(authInfo.getUser(), authInfo.getPassword() == null ? "" : authInfo.getPassword());
                    target.configuration().register(besicAuth);
                }
                Metrix.event("doRestCommand() - about to prepare request builder");
                Builder request = target.request(acceptedResponseTypes);
                Metrix.event("doRestCommand() - about to add headers");
View Full Code Here

      //turn on the Jackson feature
      .register(JacksonFeature.class)
       
      //map all the various filters we need to comply to Shopify wonky-land
      .register(JacksonContextResolver.class)
      .register(new HttpBasicAuthFilter(username, password))
      .register(FunkyPathFixer.class)
      .register(ApiCallThrottler.class)
      .register(ApiCallThrottleFeedback.class)
     
      //read by ApiCredsFilter
View Full Code Here

                    logger.log(Level.FINER, "Using auth info: User: {0}, Password: {1}",
                            new Object[]{user, ok(password) ? "<non-null>" : "<null>"});
                }
                final AuthenticationInfo authInfo = authenticationInfo();
                if (authInfo != null) {
                    HttpBasicAuthFilter besicAuth = new HttpBasicAuthFilter(authInfo.getUser(), authInfo.getPassword() == null ? "" : authInfo.getPassword());
                    target.register(besicAuth);
                }
                Metrix.event("doRestCommand() - about to prepare request builder");
                Builder request = target.request(acceptedResponseTypes);
                Metrix.event("doRestCommand() - about to add headers");
View Full Code Here

                    logger.log(Level.FINER, "Using auth info: User: {0}, Password: {1}",
                            new Object[]{user, ok(password) ? "<non-null>" : "<null>"});
                }
                final AuthenticationInfo authInfo = authenticationInfo();
                if (authInfo != null) {
                    HttpBasicAuthFilter besicAuth = new HttpBasicAuthFilter(authInfo.getUser(), authInfo.getPassword() == null ? "" : authInfo.getPassword());
                    target.configuration().register(besicAuth);
                }
                Metrix.event("doRestCommand() - about to prepare request builder");
                Builder request = target.request(acceptedResponseTypes);
                Metrix.event("doRestCommand() - about to add headers");
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.client.filter.HttpBasicAuthFilter

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.