Answer the question
In order to leave comments, you need to log in
How to get user attribute Server Radius?
Hello! The task is to make authorization through the Radius server, and if the user is not in the system, then you need to automatically create it. I work with the node-radius /. Radius created a user in the server
var account = username;
var password = req.param('password');
var packet = {
code: 'Access-Request',
secret: radius_secret,
identifier: 0,
attributes: [
['NAS-IP-Address', radius_server],
['User-Name', account],
['User-Password', password]
]
};
client.on('error', function(e) {
console.log('error');
throw e;
});
client.on('message', function(msg, rinfo) {
var radius_response = radius.decode({packet: msg, secret: radius_secret});
if(radius_response.code === 'Access-Accept') {
if(user) {
return userLogin(user);
} else {
return newRadiusUserLogin();
}
}
});
var encoded = radius.encode(packet);
client.send(encoded, 0, encoded.length, radius_port, radius_server);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question