| 1 36 package org.columba.ristretto.auth.mechanism; 37 38 import java.io.IOException ; 39 40 import org.columba.ristretto.auth.AuthenticationException; 41 import org.columba.ristretto.auth.AuthenticationMechanism; 42 import org.columba.ristretto.auth.AuthenticationServer; 43 44 49 public class LoginMechanism implements AuthenticationMechanism { 50 51 54 public void authenticate( 55 AuthenticationServer server, 56 String user, 57 char[] password) 58 throws IOException , AuthenticationException { 59 server.authReceive(); 60 61 server.authSend(user.getBytes("UTF-8")); 62 63 server.authReceive(); 64 65 server.authSend(new String (password).getBytes("UTF-8")); 66 } 67 } 68 | Popular Tags |