nickovs / unificontrol

A high-level Python interface to the Unifi controller software
Apache License 2.0
96 stars 41 forks source link

create_radius_account leaving password blank #19

Open jondurrant opened 3 years ago

jondurrant commented 3 years ago

I'm trying to auto provision radius assigned vlan using MAC address. Calling create_radius_account with username and password being same results in blank password. Any suggestions?

nickovs commented 3 years ago

@jondurrant Can you provide some details regarding your setup, and in particular what version of the Unifi controller you are running?

jondurrant commented 3 years ago

Sorry. Bit more detail on environment: Controller: atag_5.12.66_13102 (Raspberry PI hosted) Client: Python 3.9.1 being called from within Ansible Plugin. Ansible version 2.10.5

Snip of code line: self.controler.create_radius_account(cMac, cMac, 13, 6, vlan=vlanS)

josepmendoza commented 1 year ago

Maybe is related with a typo that I've found trying to create radius accounts. On controller logs: <webapi-259> WARN sanitize - Invalid key exists in Account payload, key=x_passowrd As the correct key is x_password. On unifi.py file at line 53: X_PASSWORD_FIX=fix_arg_names({"password":"x_passowrd"}) Changed to: X_PASSWORD_FIX=fix_arg_names({"password":"x_password"}) And then it worked fine.