I am currently working on the radius server. I am trying to get accounting data using tiny radius library in Java, but in response the attributes list is empty? What might be the reason for this or How can I get attributes and their values?
Here I am trying on Linux machine, MySQL with freeradius installed and I am trying to retrieve values from radius database.
This is how I tried and am trying to print attributes from an accounting response.
public void sendAuthentication() {
RadiusClient rc = new RadiusClient("localhost", "testing123");
AccessRequest ar = new AccessRequest("user", "123123");
ar.setAuthProtocol(AccessRequest.AUTH_CHAP);
RadiusPacket response;
try {
response = rc.authenticate(ar);
AccountingRequest accountingRequest = new AccountingRequest("user", ACCT_STATUS_TYPE_ACCOUNTING_ON);
response = rc.account(accountingRequest);
System.out.println(response.getAttributes());
} catch (Exception e) {
e.printStackTrace();
}
}