Package nu.fw.jeti.jabber.elements

Examples of nu.fw.jeti.jabber.elements.IQAuth


        socket = null; //clear socket reference
        sendLoginStatus(3);
        this.connectionID = connectionID;
        System.out.println(connectionID);
  //      TODO remove lowercase if filetransfer bug fixed
        output.send(new InfoQuery(null,"get",new IQAuth(loginInfo.getUsername().toLowerCase(),null,null)));
        sendLoginMessage(I18N.gettext("main.loginstatus.Getting_available_login_methods")+"...");
      }
    }
   
  }
View Full Code Here


        try {
          sha = MessageDigest.getInstance("SHA");
        } catch (Exception ex){
          Log.error(I18N.gettext("main.loginstatus.Could_not_login_with_SHA"));
          //TODO remove lowercase if filetransfer bug fixed
          output.send(new InfoQuery(null,"set",authenticationId,new IQAuth(loginInfo.getUsername().toLowerCase(),loginInfo.getPassword() ,loginInfo.getResource())));
          return;
        }

        sha.update(connectionID.getBytes());
        String digest = Utils.toString(sha.digest(loginInfo.getPassword().getBytes()));
        IQAuthBuilder iqab =  new IQAuthBuilder();
        iqab.digest = digest;
//          TODO remove lowercase if filetransfer bug fixed
        iqab.username = loginInfo.getUsername().toLowerCase();
        iqab.resource = loginInfo.getResource();
        output.send(new InfoQuery(null,"set",authenticationId,(IQExtension)iqab.build()));
      }
      else
      {
        if(!loginInfo.isSSl())
        {
          int option = JOptionPane.showConfirmDialog(null,
              I18N.gettext("main.loginstatus.Sending_password_as_plain_text_over_an_unencrypted_connection,_continue?"),"Plain text",JOptionPane.YES_NO_OPTION);
          if (option == JOptionPane.NO_OPTION)
          {
            sendLoginError("Sending password in plain not allowed");
            return;
          }
        }
//        TODO remove lowercase if filetransfer bug fixed
        output.send(new InfoQuery(null,"set",authenticationId,new IQAuth(loginInfo.getUsername().toLowerCase(),loginInfo.getPassword() ,loginInfo.getResource())));
      }
    }
  }
View Full Code Here

TOP

Related Classes of nu.fw.jeti.jabber.elements.IQAuth

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.