Package org.jboss.resteasy.skeleton.key.servlet

Examples of org.jboss.resteasy.skeleton.key.servlet.ServletOAuthClient


      // This is really the worst code ever. The ServletOAuthClient is obtained by getting a context attribute
      // that is set in the Bootstrap context listenr in this project.
      // You really should come up with a better way to initialize
      // and obtain the ServletOAuthClient.  I actually suggest downloading the ServletOAuthClient code
      // and take a look how it works.
      ServletOAuthClient oAuthClient = (ServletOAuthClient)request.getServletContext().getAttribute(ServletOAuthClient.class.getName());
      try
      {
         oAuthClient.redirectRelative("pull_data.jsp", request, response);
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here


      // This is really the worst code ever. The ServletOAuthClient is obtained by getting a context attribute
      // that is set in the Bootstrap context listenr in this project.
      // You really should come up with a better way to initialize
      // and obtain the ServletOAuthClient.  I actually suggest downloading the ServletOAuthClient code
      // and take a look how it works.
      ServletOAuthClient oAuthClient = (ServletOAuthClient)request.getServletContext().getAttribute(ServletOAuthClient.class.getName());
      String token = oAuthClient.getBearerToken(request);
      ResteasyClient client = new ResteasyClientBuilder()
                 .trustStore(oAuthClient.getTruststore())
                 .hostnameVerification(ResteasyClientBuilder.HostnameVerificationPolicy.ANY).build();
      try
      {
         // invoke without the Authorization header
         Response response = client.target("https://localhost:8443/database/products").request().get();
View Full Code Here

      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
      client = new ServletOAuthClient();
      client.setTruststore(truststore);
      client.setClientId("third-party");
      client.setPassword("password");
      client.setAuthUrl("https://localhost:8443/auth-server/login.jsp");
      client.setCodeUrl("https://localhost:8443/auth-server/j_oauth_resolve_access_code");
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.skeleton.key.servlet.ServletOAuthClient

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.