AD/LDAP/OAuth
Overview
LDAP is a lightweight version of Directory Access Protocol (DAP) and provides a standard for directory services in a network. Many software, such as Microsoft Windows Active Directory (AD) and OpenLDAP provided in many popular Linux distributions, are all implementations of LDAP. They provide a set of independent and standard login authentication systems for increasingly diverse enterprise office applications.
ZStack Cloud allows you to seamlessly integrate with the AD/LDAP unified authentication service. You can add an AD/LDAP server based on custom rules and obtain the member information. If an AD/LDAP member (user or user group) is successfully attached to a ZStack Cloud account (ordinary account or admin account), the member can directly log in to ZStack Cloud by using the member attributes.
Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| accountUuid | The account UUID. | 0.6 | ||
| ldapUid | The LDAP UID. | 0.6 | ||
| ldapServerUuid | The LDAP server UUID. | 0.6 | ||
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 |
Sample
{
"inventories": [],
"success": true
}
Operations
AddLdapServer
AddLdapServer name=ldap-server url=ldap://172.20.197.44:389 base="dc=mevoco,dc=com" \
encryption=TLS username="cn=Manager,dc=mevoco,dc=com" password=password description="ldapserver"Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource UUID. | 0.6 | ||
| description | The detailed description of the resource. | 0.6 | ||
| url | The URL of the LDAP server. | 0.6 | ||
| base | The base DN of the LDAP server. | 0.6 | ||
| username | The username used to access the LDAP server. | 0.6 | ||
| password | The password. | 0.6 | ||
| encryption | The encryption method. |
|
0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
Note:
- When you add an AD/LDAP server in ZStack Cloud, you can synchronize users by adding the
virtualIDSyncConfiguration option to SystemTags.
- Format of the virtualIDSyncConfiguration option:
virtualIDSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"cn\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"fullname\",\"attribute\":\"cn\",\"type\":\"CUSTOM\",\"optional\":\"true\"}]} - Example:
virtualIDSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"cn\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"fullname\",\"attribute\":\"cn\",\"type\":\"CUSTOM\",\"optional\":\"true\"}]}
- Format of the virtualIDSyncConfiguration option:
- When you add an AD/LDAP server in ZStack Cloud,
you can synchronize organizations by adding the
organizationSyncConfiguration option to SystemTags.
- Format of the organizationSyncConfiguration option:
organizationSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"distinguishedName\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"description\",\"attribute\":description,\"type\":\"SYSTEM\",\"optional\":\"true\"}],\"strategy\":\"Group\"} - Example:
organizationSyncConfiguration::{\"rules\":[{\"name\":\"name\",\"attribute\":\"distinguishedName\",\"type\":\"SYSTEM\",\"optional\":\"true\"},{\"name\":\"description\",\"attribute\":description,\"type\":\"SYSTEM\",\"optional\":\"true\"}],\"strategy\":\"Group\"}
- Format of the organizationSyncConfiguration option:
Note:
- When you add AD/LDAP, the system will automatically check whether the server, port, base DN, login attribute, user DN, and password are correct. The waiting time does not exceed 5 seconds.
DeleteLdapServer
DeleteLdapServer uuid=b2750052c1e34b9c868c84e645eed79aParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
QueryLdapServer
QueryLdapServer uuid=b2750052c1e34b9c868c84e645eed79aPrimitive Fields of Query
See LDAP Server Inventory.
UpdateLdapServer
UpdateLdapServer ldapServerUuid=ba240fbba3e541b4ab9db4b221cc6e7aParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| ldapServerUuid | The LDAP server UUID. | 0.6 | ||
| name | The resource name. | Yes | 0.6 | |
| description | The detailed description of the resource. | Yes | 0.6 | |
| url | The URL of the LDAP server. | Yes | 0.6 | |
| base | The base DN of the LDAP server. | Yes | 0.6 | |
| username | The username used to access the LDAP server. | Yes | 0.6 | |
| password | The password. | Yes | 0.6 | |
| encryption | The encryption method. | Yes |
|
|
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
CreateLdapBinding
CreateLdapBinding ldapUid=mevoco accountUuid=2cfc587668474aa9ae544c014bfbd36eParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| ldapUid | The LDAP UID. | 0.6 | ||
| accountUuid | The account UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
DeleteLdapBinding
DeleteLdapBinding uuid=d70c0ef1b57043beaffcfcf9b0216ac1Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
QueryLdapBinding
QueryLdapBinding ldapUid=mevocoPrimitive Fields of Query
See LDAP Binding Inventory.
CleanInvalidLdapBinding
{
"success": true
}Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
LogInByLdap
LogInByLdap uid=mevoco password=passwordParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uid | The LDAP UID. | 0.6 | ||
| password | The password. | 0.6 | ||
| captchaUuid | The verification code UUID. | Yes | 2.6.0 | |
| verifyCode | The verification code. | Yes | 2.6.0 | |
| clientInfo | The client information. | Yes | 3.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
GetLdapEntry
GetLdapEntry ldapFilter=(cn=mevoco)Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| ldapFilter | The query condition. | 2.2 | ||
| limit | The maximum number of returned records. This parameter is similar to the limit field of MySQL. | Yes | 2.2 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.2 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.2 | |
| timeout | Yes |
GetCandidateLdapEntryForBinding
GetCandidateLdapEntryForBinding ldapFilter=(cn=mevoco)Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| ldapFilter | The query condition. | 2.2 | ||
| limit | The maximum number of returned records. This parameter is similar to the limit field of MySQL. | Yes | 2.2 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.2 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.2 | |
| timeout | Yes |
CreateOAuthClient
CreateOAuthClient name=test clientId=756770202fcd36bfbaa00ea7dea7f5ff tokenUrl=http://zstack.com/token loginType=oauth2-iam2 clientType=OAuth2 grantType=authorization_codeParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 4.5.0 | ||
| description | The detailed information of the resource. | Yes | 4.5.0 | |
| clientId | The client ID. | 4.5.0 | ||
| clientSecret | The client key. | Yes | 4.5.0 | |
| authorizationUrl | The authentication url. | Yes | 4.5.0 | |
| tokenUrl | The authentication token url. | 4.5.0 | ||
| loginType | The login type. |
|
4.5.0 | |
| clientType | The client type. | 4.5.0 | ||
| grantType | The authentication type. | 4.5.0 | ||
| urlTemplate | The address jumped to after authentication. | Yes | 4.5.0 | |
| resourceUuid | The resource UUID. | Yes | 4.5.0 | |
| tagUuids | The tag UUID list. | Yes | 4.5.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 4.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 4.5.0 | |
| userinfoUrl | The user information url. | Yes | 4.7.21 | |
| redirectUrl | The redirect url. | Yes | 4.7.21 | |
| logoutUrl | The logout url. | Yes | 4.7.21 |
Tags
CreateUserTag resourceType=LdapServerVO tag=Test1 \
resourceUuid=3214e0dcd01d4e2aa8407968e1ccreatee51d58