Cannot authenticate TinyRadius with freeRadius
ulislam.raihan
raihan1780 at gmail.com
Thu Mar 15 12:44:14 CET 2012
Hi All,
I am using Tiny Radius client to authenticate with freeRadius Server. But
from freeRadius server(version 2.1.10) it can not read the password.I am
getting following msg from freeRadius server.
The user name is testing.
Password is password.
Secret is testing123.
I have test the username and password with radtest that comes with
freeRadius and it works.
The entry in users file is following.
*testing Cleartext-Password == "password"*
I will be very great full to you . if any one ca tell me how to fix it.
Thanks
Raihan
*Msg from FreeRadius Server*
rad_recv: Access-Request packet from host 127.0.0.1 port 49851, id=1,
length=59
User-Name = "testing"
NAS-IP-Address = 127.0.0.1
NAS-Port = 123
User-Password = "\317\356`\275\277\377d%q\321\341o2خ\303"
# Executing section authorize from file
/etc/freeradius/sites-enabled/default
+- entering group authorize {...}
++[preprocess] returns ok
++[chap] returns noop
++[mschap] returns noop
++[digest] returns noop
[suffix] No '@' in User-Name = "testing", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[eap] No EAP-Message, not doing EAP
++[eap] returns noop
[files] users: Matched entry testing at line 49
++[files] returns ok
++[expiration] returns noop
++[logintime] returns noop
++[pap] returns updated
Found Auth-Type = PAP
# Executing group from file /etc/freeradius/sites-enabled/default
+- entering group PAP {...}
[pap] login attempt with password "��`���d%q��o2خ�"
[pap] Using clear text password "password"
[pap] Passwords don't match
++[pap] returns reject
Failed to authenticate the user.
WARNING: Unprintable characters in the password. Double-check the
shared secret on the server and the NAS!
Using Post-Auth-Type Reject
# Executing group from file /etc/freeradius/sites-enabled/default
+- entering group REJECT {...}
[attr_filter.access_reject] expand: %{User-Name} -> testing
attr_filter: Matched entry DEFAULT at line 11
++[attr_filter.access_reject] returns updated
Delaying reject of request 5 for 1 seconds
Going to the next request
Waking up in 0.9 seconds.
Sending delayed reject for request 5
Sending Access-Reject of id 1 to 127.0.0.1 port 49851
Waking up in 4.9 seconds.
Cleaning up request 5 ID 1 with timestamp +364
*JAVA source code*
import java.io.IOException;
import org.tinyradius.*;
import org.tinyradius.packet.AccessRequest;
import org.tinyradius.packet.RadiusPacket;
import org.tinyradius.util.RadiusClient;
import org.tinyradius.util.RadiusException;
public class JavaRadiusClient {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//JavaRadiusClient jrc = new JavaRadiusClient();
//jrc.secndAuthentication();
RadiusClient rc = new RadiusClient("localhost"," testing123");
try {
if (rc.authenticate("testing", "password")) {
System.out.println("Authnticated");
}
else
System.out.println("Not Authnticated");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RadiusException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void secndAuthentication(){
RadiusClient rc = new RadiusClient("localhost"," testing123");
AccessRequest ar = new AccessRequest("testing", "password");
//ar.setAuthProtocol(AccessRequest.AUTH_CHAP); // or AUTH_PAP
ar.setAuthProtocol(AccessRequest.AUTH_PAP); // or AUTH_PAP
ar.addAttribute("NAS-IP-Address", "127.0.0.1");
ar.addAttribute("NAS-Port" ,"123");
RadiusPacket response;
try {
response = rc.authenticate(ar);
if (response.getPacketType() == RadiusPacket.ACCESS_ACCEPT) {
System.out.println("Authnticated");
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RadiusException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
--
View this message in context: http://freeradius.1045715.n5.nabble.com/Cannot-authenticate-TinyRadius-with-freeRadius-tp5567736p5567736.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.
More information about the Freeradius-Users
mailing list