Package org.eclipse.jetty.client.security

Examples of org.eclipse.jetty.client.security.BasicAuthentication


    CumulocityLongPollingTransport(Map<String, Object> options, HttpClient httpClient, PlatformParameters paramters) {
        super(options, httpClient);
        this.paramters = paramters;
        try {
            this.authentication = new BasicAuthentication(new PlatformPropertiesRealm(paramters));
        } catch (IOException e) {
            throw new SDKException("authentication failed", e);
        }
    }
View Full Code Here


  }

  @Override
  public void setBasicAuthorization(final String username, final String password) {
    try {
      BasicAuthentication auth = new BasicAuthentication(new Realm() {     
        @Override public String getPrincipal() { return username; }
        @Override public String getId() { return null; }
        @Override public String getCredentials() { return password; }
      });
     
      // The Jetty Client uses the ISO-8859-1 char-set for Basic Authentication,
      // the same as the Jetty Server. See
      // https://github.com/eclipse/jetty.project/blob/master/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java
      auth.setCredentials(exchange);
    } catch (IOException e) {
      // This happens only in the highly unlikely case that ISO-8859-1 would not be supported.
      // (BasicAuthentication should throw a RuntimeException in this case, instead of propagating a checked exception).
      // BasicAuthentication.setCredentials doesn't actually throw an IOException.
      throw new RuntimeException(e);
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.client.security.BasicAuthentication

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.