Examples of BasicAuth


Examples of com.alu.e3.prov.restapi.model.BasicAuth

    return a;
  }

  private static BasicAuth fromDataModelToBasicAuth(AuthDetail authDetail) {
    if (authDetail==null) throw new IllegalArgumentException("authDetail must not be null");
    BasicAuth b = new BasicAuth();
    b.setUsername  (authDetail.getUsername());
    b.setPassword  (authDetail.getPassword());
    return b;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.BasicAuth

    if(authType == null){
      inError = true;
      error.setErrorText("Could not determine auth-type from request.");     
    } else {
      if(authType.equals(AuthType.BASIC)){
        BasicAuth basicAuth = auth.getBasicAuth();
        if(basicAuth == null){
          inError = true;
          error.setErrorText("Request did not contain BasicAuth info.");
        } else {
          if(basicAuth.getUsername() == null || basicAuth.getUsername().isEmpty()){
            inError = true;
            error.setErrorText("Username must not be empty for Basic authentication type.");
          }
          if(basicAuth.getPassword() == null || basicAuth.getPassword().length <= 0){
            inError = true;
            error.setErrorText(error.getErrorText()+" Password must not be empty for Basic authentication type.");
          }
        }
      }
      else if(authType.equals(AuthType.WSSE)){
        WSSEAuth basicAuth = auth.getWsseAuth();
        if(basicAuth == null){
          inError = true;
          error.setErrorText("Request did not contain WsseAuth info.");
        } else {
          if(basicAuth.getUsername() == null || basicAuth.getUsername().isEmpty()){
            inError = true;
            error.setErrorText("Username must not be empty for WSSE authentication type.");
          }
          if(basicAuth.getPassword() == null || basicAuth.getPassword().length <= 0){
            inError = true;
            error.setErrorText(error.getErrorText()+" Passowrd must not be empty for WSSE authentication type.");
          }
        }
      }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.BasicAuth

    data.setType(AuthType.BASIC);
    data.setStatus(Status.ACTIVE);
    data.setApiContext("apiCtx");
    data.setPolicyContext("policyCtx");
   
    data.setBasicAuth(new BasicAuth());
    data.getBasicAuth().setUsername("username0");
    data.getBasicAuth().setPassword(("password0" + authId).getBytes());
   
    //data.setIpWhiteListAuth(new IpWhiteListAuth());
    //data.getIpWhiteListAuth().getIp().add("192.168.84.67");
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.BasicAuth

    data.setType(AuthType.BASIC);
    data.setStatus(Status.ACTIVE);
    data.setApiContext("apiCtx");
    data.setPolicyContext("policyCtx");

    data.setBasicAuth(new BasicAuth());
    data.getBasicAuth().setUsername("username0");
    data.getBasicAuth().setPassword(("password0" + authId).getBytes());

    //data.setIpWhiteListAuth(new IpWhiteListAuth());
    //data.getIpWhiteListAuth().getIp().add("192.168.84.67");
View Full Code Here

Examples of com.github.restdriver.serverdriver.http.BasicAuth

     * @param username The username.
     * @param password The password.
     * @return The new BasicAuth instance.
     */
    public static BasicAuth withBasicAuth(String username, String password) {
        return new BasicAuth(username, password);
    }
View Full Code Here

Examples of com.twitter.hbc.httpclient.auth.BasicAuth

                         String account,
                         String label,
                         String product) throws InterruptedException {
    BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);

    BasicAuth auth = new BasicAuth(username, password);

    RealTimeEnterpriseStreamingEndpoint endpoint = new RealTimeEnterpriseStreamingEndpoint(account, product, label);

    // Create a new BasicClient. By default gzip is enabled.
    Client client = new ClientBuilder()
View Full Code Here

Examples of com.twitter.hbc.httpclient.auth.BasicAuth

     */
    try {
      new ClientBuilder()
              .endpoint(new StatusesSampleEndpoint())
              .processor(new NullProcessor())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }


    /**
     * Client builder fails to build with no endpoint specified
     */
    try {
      new ClientBuilder()
              .hosts(new HttpHosts(Constants.STREAM_HOST))
              .processor(new NullProcessor())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }

    /**
     * Client builder fails to build with no processor specified
     */
    try {
      new ClientBuilder()
              .hosts(new HttpHosts(Constants.STREAM_HOST))
              .endpoint(new StatusesSampleEndpoint())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }
View Full Code Here

Examples of com.twitter.hbc.httpclient.auth.BasicAuth

  public void testBuilderSuccess() {
    new ClientBuilder()
            .hosts(new HttpHosts(Constants.STREAM_HOST))
            .endpoint(new StatusesSampleEndpoint())
            .processor(new NullProcessor())
            .authentication(new BasicAuth("username", "password"))
            .build();

  }
View Full Code Here

Examples of com.twitter.hbc.httpclient.auth.BasicAuth

    try {
      new ClientBuilder()
              .hosts(new HttpHosts(Constants.STREAM_HOST))
              .endpoint(StatusesSampleEndpoint.PATH, "FAIL!")
              .processor(new NullProcessor())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }
View Full Code Here

Examples of com.twitter.hbc.httpclient.auth.BasicAuth

  public void testValidHttpMethod() {
    new ClientBuilder()
            .hosts(new HttpHosts(Constants.STREAM_HOST))
            .endpoint(StatusesSampleEndpoint.PATH, "gEt")
            .processor(new NullProcessor())
            .authentication(new BasicAuth("username", "password"))
            .build();

  }
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.