Examples of CsrfProtectionFilter


Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

    }

    this.ambariWebResource = client.resource(url);

    //Install auth filters
    ClientFilter csrfFilter = new CsrfProtectionFilter("RequestSchedule");
    ClientFilter tokenFilter = new InternalTokenClientFilter(tokenStorage);
    ambariClient.addFilter(csrfFilter);
    ambariClient.addFilter(tokenFilter);

  }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

        if (configuration.isAuthorisation()) {
            client.addFilter(new HTTPBasicAuthFilter(
                           configuration.getAdminUser(),
                           configuration.getAdminPassword()));
        }
        client.addFilter(new CsrfProtectionFilter());
        return client.resource(this.adminBaseUrl + additionalResourceUrl).accept(MediaType.APPLICATION_XML_TYPE);
    }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

    this.ambariClient = client;
    this.ambariWebResource = client.resource(url);

    //Install auth filters
    ClientFilter csrfFilter = new CsrfProtectionFilter("RequestSchedule");
    ClientFilter tokenFilter = new InternalTokenClientFilter(tokenStorage);
    ambariClient.addFilter(csrfFilter);
    ambariClient.addFilter(tokenFilter);

  }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

        if (configuration.isAuthorisation()) {
            client.addFilter(new HTTPBasicAuthFilter(
                           configuration.getAdminUser(),
                           configuration.getAdminPassword()));
        }
        client.addFilter(new CsrfProtectionFilter());
        return client.resource(this.adminBaseUrl + additionalResourceUrl).accept(MediaType.APPLICATION_XML_TYPE).header("X-GlassFish-3", "ignore");
    }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

            Habitat habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getComponent(SecureAdmin.class);
            HTTPSProperties httpsProperties = new HTTPSProperties(new BasicHostnameVerifier(),
                habitat.getComponent(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null ));
            client.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpsProperties);
            client.addFilter(new CsrfProtectionFilter());
        }catch(Exception ex){
            GuiUtil.getLogger().warning("RestUtil.initialize() failed");
            if (GuiUtil.getLogger().isLoggable(Level.FINE)){
                ex.printStackTrace();
            }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

            Habitat habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getComponent(SecureAdmin.class);
            HTTPSProperties httpsProperties = new HTTPSProperties(new BasicHostnameVerifier(),
                habitat.getComponent(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null ));
            client.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpsProperties);
            client.addFilter(new CsrfProtectionFilter());
        }catch(Exception ex){
            GuiUtil.getLogger().warning("RestUtil.initialize() failed");
            if (GuiUtil.getLogger().isLoggable(Level.FINE)){
                ex.printStackTrace();
            }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.CsrfProtectionFilter

            Habitat habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getComponent(SecureAdmin.class);
            HTTPSProperties httpsProperties = new HTTPSProperties(new BasicHostnameVerifier(),
                habitat.getComponent(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null ));
            client.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpsProperties);
            client.addFilter(new CsrfProtectionFilter());
        }catch(Exception ex){
            GuiUtil.getLogger().warning("RestUtil.initialize() failed");
            if (GuiUtil.getLogger().isLoggable(Level.FINE)){
                ex.printStackTrace();
            }
View Full Code Here

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

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

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

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

    public ClientWrapper(final Map<String, String> headers, String userName, String password) {
        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() {
View Full Code Here

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

    private static Client JERSEY_CLIENT;

    public static Client getJerseyClient() {
        if (JERSEY_CLIENT == null) {
            JERSEY_CLIENT = ClientFactory.newClient();
            JERSEY_CLIENT.register(new CsrfProtectionFilter())
                    .register(new RequiredHeadersFilter())
                    .register(new JacksonFeature());
        }

        return JERSEY_CLIENT;
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.