template.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package ldap
  15. import (
  16. api "yunion.io/x/onecloud/pkg/apis/identity"
  17. )
  18. var (
  19. MicrosoftActiveDirectorySingleDomainTemplate = api.SLDAPIdpConfigOptions{
  20. UserObjectclass: "organizationalPerson",
  21. UserIdAttribute: "sAMAccountName",
  22. UserNameAttribute: "sAMAccountName",
  23. UserEnabledAttribute: "userAccountControl",
  24. UserEnabledMask: 2,
  25. UserEnabledDefault: "512",
  26. UserEnabledInvert: true,
  27. UserAdditionalAttribute: []string{
  28. "displayName:displayname",
  29. "telephoneNumber:mobile",
  30. "mail:email",
  31. },
  32. UserQueryScope: "sub",
  33. GroupObjectclass: "group",
  34. GroupIdAttribute: "sAMAccountName",
  35. GroupNameAttribute: "name",
  36. GroupMemberAttribute: "member",
  37. GroupMembersAreIds: false,
  38. GroupQueryScope: "sub",
  39. }
  40. MicrosoftActiveDirectoryMultipleDomainTemplate = api.SLDAPIdpConfigOptions{
  41. DomainObjectclass: "organizationalUnit",
  42. DomainIdAttribute: "objectGUID",
  43. DomainNameAttribute: "name",
  44. DomainQueryScope: "one",
  45. UserObjectclass: "organizationalPerson",
  46. UserIdAttribute: "sAMAccountName",
  47. UserNameAttribute: "sAMAccountName",
  48. UserEnabledAttribute: "userAccountControl",
  49. UserEnabledMask: 2,
  50. UserEnabledDefault: "512",
  51. UserEnabledInvert: true,
  52. UserAdditionalAttribute: []string{
  53. "displayName:displayname",
  54. "telephoneNumber:mobile",
  55. "mail:email",
  56. },
  57. UserQueryScope: "sub",
  58. GroupObjectclass: "group",
  59. GroupIdAttribute: "sAMAccountName",
  60. GroupNameAttribute: "name",
  61. GroupMemberAttribute: "member",
  62. GroupMembersAreIds: false,
  63. GroupQueryScope: "sub",
  64. }
  65. OpenLdapSingleDomainTemplate = api.SLDAPIdpConfigOptions{
  66. UserObjectclass: "person",
  67. UserIdAttribute: "uid",
  68. UserNameAttribute: "uid",
  69. UserEnabledAttribute: "nsAccountLock",
  70. UserEnabledDefault: "FALSE",
  71. UserEnabledInvert: true,
  72. UserAdditionalAttribute: []string{
  73. "displayName:displayname",
  74. "mobile:mobile",
  75. "mail:email",
  76. },
  77. UserQueryScope: "sub",
  78. GroupObjectclass: "ipausergroup",
  79. GroupIdAttribute: "cn",
  80. GroupNameAttribute: "cn",
  81. GroupMemberAttribute: "member",
  82. GroupMembersAreIds: false,
  83. GroupQueryScope: "sub",
  84. }
  85. )