<bdo id='0k9lw'></bdo><ul id='0k9lw'></ul>
    1. <small id='0k9lw'></small><noframes id='0k9lw'>

    2. <tfoot id='0k9lw'></tfoot>
      <i id='0k9lw'><tr id='0k9lw'><dt id='0k9lw'><q id='0k9lw'><span id='0k9lw'><b id='0k9lw'><form id='0k9lw'><ins id='0k9lw'></ins><ul id='0k9lw'></ul><sub id='0k9lw'></sub></form><legend id='0k9lw'></legend><bdo id='0k9lw'><pre id='0k9lw'><center id='0k9lw'></center></pre></bdo></b><th id='0k9lw'></th></span></q></dt></tr></i><div id='0k9lw'><tfoot id='0k9lw'></tfoot><dl id='0k9lw'><fieldset id='0k9lw'></fieldset></dl></div>
      1. <legend id='0k9lw'><style id='0k9lw'><dir id='0k9lw'><q id='0k9lw'></q></dir></style></legend>

      2. 使用 objectGUID 查询 - Spring LDAP 模板

        时间:2024-05-10

      3. <small id='lDRn8'></small><noframes id='lDRn8'>

            <i id='lDRn8'><tr id='lDRn8'><dt id='lDRn8'><q id='lDRn8'><span id='lDRn8'><b id='lDRn8'><form id='lDRn8'><ins id='lDRn8'></ins><ul id='lDRn8'></ul><sub id='lDRn8'></sub></form><legend id='lDRn8'></legend><bdo id='lDRn8'><pre id='lDRn8'><center id='lDRn8'></center></pre></bdo></b><th id='lDRn8'></th></span></q></dt></tr></i><div id='lDRn8'><tfoot id='lDRn8'></tfoot><dl id='lDRn8'><fieldset id='lDRn8'></fieldset></dl></div>

            <legend id='lDRn8'><style id='lDRn8'><dir id='lDRn8'><q id='lDRn8'></q></dir></style></legend>
                <tbody id='lDRn8'></tbody>
              • <bdo id='lDRn8'></bdo><ul id='lDRn8'></ul>

                1. <tfoot id='lDRn8'></tfoot>
                  本文介绍了使用 objectGUID 查询 - Spring LDAP 模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试获取、存储并反过来使用 objectGUID 来查询 Active Directory.要获取用户属性,我正在使用以下

                  I am trying to fetch, store and in turn use objectGUID to query Active directory. To get user attributes i am using following

                  public static class MyDnKeyValueAttMapper implements AttributesMapper<Object> {
                          @Override
                          public List<LdapKeyValueList> mapFromAttributes(Attributes attributes)
                                  throws NamingException, javax.naming.NamingException {
                              List<LdapKeyValueList> attributeKeyValMap = new ArrayList<LdapKeyValueList>();
                              NamingEnumeration<String> namingEnumeration = attributes.getIDs();
                  
                              while (namingEnumeration.hasMoreElements()) {
                                  String attributeName = (String) namingEnumeration.nextElement();
                                  String AttributeValue = attributes.get(attributeName).get().toString();
                                  attributeKeyValMap.add(new LdapKeyValueList(attributeName, AttributeValue));
                              }
                              return attributeKeyValMap;
                          }
                      }
                  

                  objectGuid 似乎总是以字符串格式返回.我也试过-

                  objectGuid always seems to be returned in string format. I have also tried -

                  UUID guid = (UUID) attributes.get("objectGUID").get();
                  

                  这会引发无法将字符串转换为 uuid"的错误

                  This throws error of "cannot convert string to uuid"

                  似乎在我可以做任何事情之前 ldaptemplate 搜索总是以字符串格式返回属性.

                  Seems like before i can do anything ldaptemplate search always return attributes in string format.

                  如何获取objectGUID"的格式,以便存储并在 ldapTemplate 搜索查询中使用.

                  How can i get hold of "objectGUID" in its format, so that i can store it and use in ldapTemplate search queries.

                  提前致谢.

                  推荐答案

                  如果您不想将二进制属性(objectGUID 具有 Octet String 语法)作为字符串检索,则必须这样说.使用 Spring,您必须将 <entry key="java.naming.ldap.attributes.binary" value="objectGUID"/> 添加到您的上下文环境中.

                  If you don't want a binary attribute (objectGUID has Octet String syntax) to be retrieved as a string, you must say so. With Spring you'll have to add <entry key="java.naming.ldap.attributes.binary" value="objectGUID"/> to your context environment.

                  稍后 byte[] guid = (byte[])namingEnumeration.getAttributes().get("objectGUID").get(); 应该会返回您要查找的内容.

                  Later on byte[] guid = (byte[]) namingEnumeration.getAttributes().get("objectGUID").get(); should return what you're looking for.

                  只是输入,未测试.

                  这篇关于使用 objectGUID 查询 - Spring LDAP 模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 jndi 显示 ldap 目录的所有对象类描述 下一篇:Spring Security Ldap,只登录指定组中的用户

                  相关文章

                  <tfoot id='5vd8h'></tfoot>
                  • <bdo id='5vd8h'></bdo><ul id='5vd8h'></ul>
                  <legend id='5vd8h'><style id='5vd8h'><dir id='5vd8h'><q id='5vd8h'></q></dir></style></legend>

                  <i id='5vd8h'><tr id='5vd8h'><dt id='5vd8h'><q id='5vd8h'><span id='5vd8h'><b id='5vd8h'><form id='5vd8h'><ins id='5vd8h'></ins><ul id='5vd8h'></ul><sub id='5vd8h'></sub></form><legend id='5vd8h'></legend><bdo id='5vd8h'><pre id='5vd8h'><center id='5vd8h'></center></pre></bdo></b><th id='5vd8h'></th></span></q></dt></tr></i><div id='5vd8h'><tfoot id='5vd8h'></tfoot><dl id='5vd8h'><fieldset id='5vd8h'></fieldset></dl></div>

                  <small id='5vd8h'></small><noframes id='5vd8h'>