public void authenticate(String name,String password) throws IOException, NoSuchAlgorithmException, RejectException, ChallengeException {
  AccessRequest req=createAccessRequest();
  req.addAttribute(new UserNameAttribute(name));
  req.addAttribute(new UserPasswordAttribute(req.getAuthenticator(),secret,password));
  req.addAttribute(new NASIPAddressAttribute(InetAddress.getLocalHost()));
  req.addAttribute(new NASPortAttribute(socket.getLocalPort()));
  sendPacket(req);
}

public void authenticate ( String name , String password ) throws IOException , NoSuchAlgorithmException , RejectException , ChallengeException { AccessRequest req = createAccessRequest ( ) ; req . addAttribute ( new UserNameAttribute ( name ) ) ; req . addAttribute ( new UserPasswordAttribute ( req . getAuthenticator ( ) , secret , password ) ) ; req . addAttribute ( new NASIPAddressAttribute ( InetAddress . getLocalHost ( ) ) ) ; req . addAttribute ( new NASPortAttribute ( socket . getLocalPort ( ) ) ) ; sendPacket ( req ) ; }
authenticates the username and password against the remote servers .
