Examples of Authenticator


Examples of com.caucho.security.Authenticator

    }
  }
 
  void authenticate(String to, Object credentials, String ipAddress)
  {
    Authenticator auth = getAuth();

    if (credentials instanceof SignedCredentials) {
      SignedCredentials signedCred = (SignedCredentials) credentials;

      String uid = signedCred.getUid();
      String nonce = signedCred.getNonce();
      String signature = signedCred.getSignature();
     
      /*
      String savedNonce = _nonceMap.get(uid);
     
      if (savedNonce == null)
        throw new NotAuthorizedException(L.l("'{0}' has invalid credentials",
                                             uid));
                                             */
     
      String serverSignature;
     
      if (uid != null && ! uid.equals("")) {
        serverSignature = _security.signSystem(uid, nonce);
      }
      else if (_security.isSystemAuthKey() || ! _isAuthenticationRequired)
        serverSignature = _security.signSystem(uid, nonce);
      else {
        log.info("Authentication failed because no resin-system-auth-key");
       
        throw new NotAuthorizedException(L.l("'{0}' has invalid credentials",
                                             uid));
      }
     
      if (! serverSignature.equals(signature)) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid credentials",
                                             uid));
      }
    }
    else if (auth == null && ! _isAuthenticationRequired) {
    }
    else if (auth == null) {
      log.finer("Authentication failed because no authenticator configured");
     
      throw new NotAuthorizedException(L.l("'{0}' has missing authenticator",
                                           credentials));
    }
    else if (credentials instanceof DigestCredentials) {
      DigestCredentials digestCred = (DigestCredentials) credentials;

      Principal user = new BasicPrincipal(digestCred.getUserName());
     
      user = auth.authenticate(user, digestCred, null);

      if (user == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid digest credentials",
                                             digestCred.getUserName()));
      }
    }
    else if (credentials instanceof String) {
      String password = (String) credentials;
   
      Principal user = new BasicPrincipal(to);
      PasswordCredentials pwdCred = new PasswordCredentials(password);
   
      if (auth.authenticate(user, pwdCred, null) == null) {
        throw new NotAuthorizedException(L.l("'{0}' has invalid password credentials",
                                             to));
      }
    }
    /*
 
View Full Code Here

Examples of com.cloudera.alfredo.client.Authenticator

   */
  private HttpURLConnection getConnection(String method, Map<String, String> params, Path path) throws IOException {
    params.put("doas", doAs);
    Class<? extends Authenticator> klass =
      getConf().getClass("hoop.authenticator.class", HoopKerberosAuthenticator.class, Authenticator.class);
    Authenticator authenticator = ReflectionUtils.newInstance(klass, getConf());
    try {
      StringBuilder sb = new StringBuilder();
      String separator = "?";
      for (Map.Entry<String, String> entry : params.entrySet()) {
        sb.append(separator).append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(),
View Full Code Here

Examples of com.hazelcast.client.connection.Authenticator

        }
    }

    @Override
    public ClientConnection tryToConnect(Address target) throws Exception {
        Authenticator authenticator = new ClusterAuthenticator();
        int count = 0;
        IOException lastError = null;
        while (count < RETRY_COUNT) {
            try {
                if (target == null || !isMember(target)) {
View Full Code Here

Examples of com.liferay.portal.auth.Authenticator

          if ((PRE_AUTHENTICATOR != null) &&
            (0 < PRE_AUTHENTICATOR.length()) &&
            PRE_AUTHENTICATOR.equals(Config.getStringProperty("LDAP_FRONTEND_AUTH_IMPLEMENTATION"))) {
            Class ldap_auth_impl_class = Class.forName(Config.getStringProperty("LDAP_FRONTEND_AUTH_IMPLEMENTATION"));
            Authenticator ldap_auth_impl = (Authenticator) ldap_auth_impl_class.newInstance();
            int auth = 0;

          if (comp.getAuthType().equals(Company.AUTH_TYPE_EA)) {
            auth = ldap_auth_impl.authenticateByEmailAddress(comp.getCompanyId(), userName, password);
        } else {
          auth = ldap_auth_impl.authenticateByUserId(comp.getCompanyId(), userName, password);
        }

          if (comp.getAuthType().equals(Company.AUTH_TYPE_EA)) {
                user = APILocator.getUserAPI().loadByUserByEmail(userName, APILocator.getUserAPI().getSystemUser(), false);
              } else {
View Full Code Here

Examples of com.loja.security.Authenticator

  public void setSenha(String senha) {
    this.senha = senha;
  }
 
  public void senhaToMd5() {
    setSenha(new Authenticator().toHash(this.senha));
  }
View Full Code Here

Examples of com.seomoz.api.authentication.Authenticator

    String accessID = "";
   
    //Add your secretKey here
    String secretKey = "";
   
    Authenticator authenticator = new Authenticator();
    authenticator.setAccessID(accessID);
    authenticator.setSecretKey(secretKey);
   
    /*
    URLMetricsService urlMetricsService = new URLMetricsService(authenticator);
    String response = urlMetricsService.getUrlMetrics(objectURL);
    Gson gson = new Gson();
View Full Code Here

Examples of com.sun.net.httpserver.Authenticator

    List<Filter> getSystemFilters () {
        return sfilters;
    }

    public Authenticator setAuthenticator (Authenticator auth) {
        Authenticator old = authenticator;
        authenticator = auth;
        authfilter.setAuthenticator (auth);
        return old;
    }
View Full Code Here

Examples of de.iritgo.aktera.authentication.Authenticator

  @Override
  public Object performWithResult()
  {
    String userName = properties.getProperty("userName");
    String password = properties.getProperty("password");
    Authenticator authenticator = (Authenticator) SpringTools.getBean(Authenticator.ID);
    return authenticator.authenticate(userName, password);
  }
View Full Code Here

Examples of edu.wpi.cs.wpisuitetng.authentication.Authenticator

 
  @Test
  public void testTitle()
  {
    String expectedHeader = "<html> <head> <title> 403 </title> </head>";
    Authenticator auth = new BasicAuth();
    try {
      auth.login("this shoud break it!");
    }
    catch(WPISuiteException e)
    {
      String error = this.formatter.formatContent(e);
      String statusCode = String.valueOf(e.getStatus());
View Full Code Here

Examples of fitnesse.authentication.Authenticator

  }

  public static Authenticator makeAuthenticator(
      String authenticationParameter, ComponentFactory componentFactory)
      throws Exception {
    Authenticator authenticator = new PromiscuousAuthenticator();
    if (authenticationParameter != null) {
      if (new File(authenticationParameter).exists())
        authenticator = new MultiUserAuthenticator(
            authenticationParameter);
      else {
View Full Code Here
TOP
Copyright © 2015 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.