VMware {code} Community
sashatankist
Contributor
Contributor

Rest api register active directory user

Hoo can say me how create from  rest api active directory user and asign him role ?
im try somfing like this, im login inside domain from vcenter gui but my list providers stay blank

curl -k -X POST -H "vmware-api-session-id: <toke>" -H "Content-Type: application/json" \
-d '{
"active_directory_over_ldap": {
"groups_base_dn": "cn=users,dc=torgsoft,dc=local",
"password": "XXXXX",
"server_endpoints": ["torgsoft.local"],
"user_name": "administrator@torgsoft.local",
"users_base_dn": "cn=users,dc=torgsoft,dc=local"
},
"idm_protocol": ""
}' "https://vnc.torgsoft.local/api/vcenter/identity/providers" | jq

and in answer server tell me 
"default_message": "Structure com.vmware.vcenter.identity.providers.create_spec has a union constraint with tag 'idm_protocol' of value '', for which the field 'active_directory_over_ldap' is not allowed to be set.",
0 Kudos
1 Reply
doskiran
Enthusiast
Enthusiast

Make sure to add idm_protocol and server_endpoints ( in active_directory_over_ldap)
eg:

"idm_protocol": "LDAP"

 and

"server_endpoints": [
          "ldap://<server>:<port>"
         ]


 

0 Kudos