Isaksson / node-red-contrib-unifi

MIT License
52 stars 20 forks source link

Possible to add the Radius Profile commands ? #118

Closed ReziioAdmin closed 1 year ago

ReziioAdmin commented 1 year ago

Hi

I am trying to get a setup where I can manage the Radius server and Radius Users via NodeRed. I see in the API guide that 2 commands are listed :

rest/radiusprofile | GET/POST/PUT | Radius profiles rest/account | GET/POST/PUT | Radius accounts

Is there any way I can directly access these commands or is this something you would have to add your list of commands in the node ?

Isaksson commented 1 year ago

Hello. Its not possible to just access those commands, they has to added to the code.

If this commands is added would that solve your issue? get radius profiles get radius users modify radius user delete radius user

ReziioAdmin commented 1 year ago

Yes. That would be perfect. Thank you !

Sent from my iPhone

On Oct 6, 2023, at 1:31 PM, Kristoffer Isaksson @.***> wrote:



Hello. Its not possible to just access those commands, they has to added to the code.

If this commands is added would that solve your issue? get radius profiles get radius users modify radius user delete radius user

— Reply to this email directly, view it on GitHubhttps://github.com/Isaksson/node-red-contrib-unifi/issues/118#issuecomment-1751162585, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWJTDPUAQB7KL7WICN227V3X6A57BAVCNFSM6AAAAAA5WCPD4OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRGE3DENJYGU. You are receiving this because you authored the thread.Message ID: @.***>

ReziioAdmin commented 1 year ago

Would it be possible to also include "Add radius user" or is this already covered under the "Modify User" option ?

Isaksson commented 1 year ago

I think that will be possible, I will let you make the most tests when I have created the functions :)

ReziioAdmin commented 1 year ago

Thank you !! 👍 I will be very happy to test when you let me know you made the changes

Isaksson commented 1 year ago

I have now published new version that includes commands for radius.

Get radius user: msg.payload = { command: "getradiususers"} return msg;

Get radius profiles: msg.payload = { command: "getradiusprofiles" } return msg;

Create radius user: (its optional to use tunnel_type, tunnel_medium and vlan) msg.payload = { command: "CreateRadiusUser", name: "TestNR2", x_password: "abcdefgh123", tunnel_type: "1", tunnel_medium_type: "1", vlan: "10" } return msg;

Update radius user: (include the parameters that you want to modify) msg.payload = { command: "UpdateRadiusUser", user_id: "6521cf2de33e243de77bab7f", name: "TestNR2222", x_password: "11abcdefgh123"} return msg;

Delete radius user: msg.payload = { command: "DeleteRadiusUser", user_id: "6521c473e33e243de77ba58e" } return msg;

Let me know how it goes.

ReziioAdmin commented 1 year ago

Hi

Thank you for this. I have tested everything I can think of and all works perfectly.

I do have one more question though - If I set up mode than one Radius server would we need to add some ID to each of the commands to address the correct server ?

Isaksson commented 1 year ago

Hello. Sounds good that it is working.

The default one is in the system and it handles the accounts, if you add a new radius server then there will be no users in the Unifi system for that radius configuration that will be on the radius server that you just added, for example Microsoft NPS and store user information in Active Directory. I dont think you can add multiple radius servers on Unifi that both will handle added users.

ReziioAdmin commented 1 year ago

Yes - that makes sense. Thank you for your very quick response to this request. Much appreciated !