OPNsense Forum

English Forums => General Discussion => Topic started by: sepultra on January 18, 2023, 10:36:54 AM

Title: Problem with user creation Freeradius over API call
Post by: sepultra on January 18, 2023, 10:36:54 AM
Hello,

For my guest WLAN I have the authentication running via Freeradius.

However, I have a problem when creating users in Freeradius via the API.
The user is created in the UI and is also visible in the list, but when I try to log in to the guest WLAN with it, I get the error message: "Authentication failed".

If I then go to the Freeradius UI and press the "Apply" button once for users, the login works with the previously created users.

I noticed that in the file "/usr/local/etc/raddb/mods-config/files/authorize" the user is only there after pressing the "Apply" button.

Has anyone had this problem before and a solution?
Title: Re: Problem with user creation Freeradius over API call
Post by: InstigatorX on February 20, 2024, 09:02:57 PM
I know this is old, but what command are you using? I'm looking for starting point to bulk add users with the API.
Title: Re: Problem with user creation Freeradius over API call
Post by: Klaus2002 on January 19, 2025, 03:10:51 PM
https://XX.XX.XX.XX/api/freeradius/user/addUser
{
  "user": {
    "username": "testuser",
    "password": "securepassword",
    "description": "John Doe"
  }
}

https://XX.XX.XX.XX/api/freeradius/user/delUser/5d80ab6e-fbaf-40b6-a82a-113391a5e803

https://XX.XX.XX.XX/api/freeradius/service/restart

https://XX.XX.XX.XX/api/freeradius/service/reconfigure