Hi, I tried to create a PowerShell script as Cedrik suggested, but I struggle.
As I never worked with the API commands before, I read the API documentation and did some exercises.
For testing purposes, I created a bash script with a curl command:
API_KEY="my Api key"
API_SECRET="my api secret"
# Base64 encode credentials
ENCODED_CREDENTIALS=$(echo -n "$API_KEY:$API_SECRET" | base64)
curl -k -v "https://opnsense-ip/api/auth/user/add" \
-u "$API_KEY:$API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"username": "test",
"password": "securepassword123",
"group_memberships": ["admins"]
}'
but this returns a "failed" message.
My intention is to enable the MS AD users for OpenVPN and of course it would be great if I delete one AD user,
the OpenVPN "dial in" for this user is deleted as well. Perhaps I am completely on the wrong track.
I am happy for any kind of hints.
As I never worked with the API commands before, I read the API documentation and did some exercises.
For testing purposes, I created a bash script with a curl command:
API_KEY="my Api key"
API_SECRET="my api secret"
# Base64 encode credentials
ENCODED_CREDENTIALS=$(echo -n "$API_KEY:$API_SECRET" | base64)
curl -k -v "https://opnsense-ip/api/auth/user/add" \
-u "$API_KEY:$API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"username": "test",
"password": "securepassword123",
"group_memberships": ["admins"]
}'
but this returns a "failed" message.
My intention is to enable the MS AD users for OpenVPN and of course it would be great if I delete one AD user,
the OpenVPN "dial in" for this user is deleted as well. Perhaps I am completely on the wrong track.
I am happy for any kind of hints.