src/main/java/org/tinyradius/test/TestClient.java
public static void main(String[] args)
        throws Exception {
        if (args.length != 4) {
            System.out.println("Usage: TestClient hostName sharedSecret userName password");
            System.exit(1);
        }

        String host = args[0];
        String shared = args[1];
        String user = args[2];
        String pass = args[3];

        RadiusClient rc = new RadiusClient(host, shared);

        // 1. Send Access-Request
        AccessRequest ar = new AccessRequest(user, pass);
        ar.setAuthProtocol(AccessRequest.AUTH_PAP); // or AUTH_CHAP
        ar.addAttribute("NAS-Identifier", "this.is.my.nas-identifier.de");
        ar.addAttribute("NAS-IP-Address", "192.168.0.100");
        ar.addAttribute("Service-Type", "Login-User");
        ar.addAttribute("WISPr-Redirection-URL", "http://www.sourceforge.net/");
        ar.addAttribute("WISPr-Location-ID", "net.sourceforge.ap1");

        System.out.println("Packet before it is sent\n" + ar + "\n");
        RadiusPacket response = rc.authenticate(ar);
        System.out.println("Packet after it was sent\n" + ar + "\n");
        System.out.println("Response\n" + response + "\n");

        // 2. Send Accounting-Request
        AccountingRequest acc = new AccountingRequest("mw", AccountingRequest.ACCT_STATUS_TYPE_START);
        acc.addAttribute("Acct-Session-Id", "1234567890");
        acc.addAttribute("NAS-Identifier", "this.is.my.nas-identifier.de");
        acc.addAttribute("NAS-Port", "0");

        System.out.println(acc + "\n");
        response = rc.account(acc);
        System.out.println("Response: " + response);

        rc.close();
    }
/**
     * Radius command line client.
     * <br/>Usage: TestClient <i>hostName sharedSecret userName password</i>
     *
     * @param args arguments
     * @throws Exception
     */
Radius command line client.
Usage: TestClient hostName sharedSecret userName password

@param args arguments
@throws Exception
Radius command line client . Usage : TestClient hostName sharedSecret userName password @param args arguments @throws Exception
public static void main(String[] args)
        throws Exception {
        if (args.length != 4) {
            System.out.println("Usage: TestClient hostName sharedSecret userName password");
            System.exit(1);
        }
        String host = args[0];
        String shared = args[1];
        String user = args[2];
        String pass = args[3];
        RadiusClient rc = new RadiusClient(host, shared);
        AccessRequest ar = new AccessRequest(user, pass);
        ar.setAuthProtocol(AccessRequest.AUTH_PAP); 
        ar.addAttribute("NAS-Identifier", "this.is.my.nas-identifier.de");
        ar.addAttribute("NAS-IP-Address", "192.168.0.100");
        ar.addAttribute("Service-Type", "Login-User");
        ar.addAttribute("WISPr-Redirection-URL", "http://www.sourceforge.net/");
        ar.addAttribute("WISPr-Location-ID", "net.sourceforge.ap1");
        System.out.println("Packet before it is sent\n" + ar + "\n");
        RadiusPacket response = rc.authenticate(ar);
        System.out.println("Packet after it was sent\n" + ar + "\n");
        System.out.println("Response\n" + response + "\n");
        AccountingRequest acc = new AccountingRequest("mw", AccountingRequest.ACCT_STATUS_TYPE_START);
        acc.addAttribute("Acct-Session-Id", "1234567890");
        acc.addAttribute("NAS-Identifier", "this.is.my.nas-identifier.de");
        acc.addAttribute("NAS-Port", "0");
        System.out.println(acc + "\n");
        response = rc.account(acc);
        System.out.println("Response: " + response);
        rc.close();
    }
public static void main ( String [ ] args ) throws Exception { if ( args . length != 4 ) { System . out . println ( "Usage: TestClient hostName sharedSecret userName password" ) ; System . exit ( 1 ) ; } String host = args [ 0 ] ; String shared = args [ 1 ] ; String user = args [ 2 ] ; String pass = args [ 3 ] ; RadiusClient rc = new RadiusClient ( host , shared ) ; AccessRequest ar = new AccessRequest ( user , pass ) ; ar . setAuthProtocol ( AccessRequest . AUTH_PAP ) ; ar . addAttribute ( "NAS-Identifier" , "this.is.my.nas-identifier.de" ) ; ar . addAttribute ( "NAS-IP-Address" , "192.168.0.100" ) ; ar . addAttribute ( "Service-Type" , "Login-User" ) ; ar . addAttribute ( "WISPr-Redirection-URL" , "http://www.sourceforge.net/" ) ; ar . addAttribute ( "WISPr-Location-ID" , "net.sourceforge.ap1" ) ; System . out . println ( "Packet before it is sent\n" + ar + "\n" ) ; RadiusPacket response = rc . authenticate ( ar ) ; System . out . println ( "Packet after it was sent\n" + ar + "\n" ) ; System . out . println ( "Response\n" + response + "\n" ) ; AccountingRequest acc = new AccountingRequest ( "mw" , AccountingRequest . ACCT_STATUS_TYPE_START ) ; acc . addAttribute ( "Acct-Session-Id" , "1234567890" ) ; acc . addAttribute ( "NAS-Identifier" , "this.is.my.nas-identifier.de" ) ; acc . addAttribute ( "NAS-Port" , "0" ) ; System . out . println ( acc + "\n" ) ; response = rc . account ( acc ) ; System . out . println ( "Response: " + response ) ; rc . close ( ) ; }
Radius command line client.
Radius command line client .
// 1. Send Access-Request
 // or AUTH_CHAP
 // 2. Send Accounting-Request
