简体   繁体   中英

SAP ABAP LDAP Active directory photos

I am trying to retrieve user photos that are stored in Active Directory with LDAP integration. I want to display pictures in a BSP application. I handled the login operation with the 'LDAP_SIMPLEBIND' function. It is working like a charm. However I cannot get photos. I tried 'LDAP_SEARCH' with this filter:

(&(objectCategory=person)(objectClass=user)(samaccountname=*))

This function is returning "thumbnailphoto" attribute but it is not a byte array that can be converted into jpeg or png file, I think!

Function call:

    CALL FUNCTION 'LDAP_SEARCH'
      EXPORTING
        base         = base
*       scope        = scope
*       mode         = mode
*       CROP         = 'X'
        filter       = filter
*       timeout      = timeout
*        IMPORTING
*       LDAPRC       = LDAPRC
      TABLES
        dns_out      = lt_dns_out
        attrs_io     = lt_attrs_io
        values_out   = lt_vals_out
      EXCEPTIONS
        no_authoriz  = 1
        conn_outdate = 2
        ldap_failure = 3
        not_alive    = 4
        other_error  = 5
        OTHERS       = 6.

In lt_attrs_io and lt_vals_out table , I have two lines about thumbnailphoto. I try to display in other views and in hex format.

在此处输入图片说明 在此处输入图片说明

For example:

?#???yN?????uF

88218628259840

What am I missing? I cannot find anything on the web about this issue in ABAP. There are some solutions in C#, Java or nodejs, but nothing for ABAP as far as I see.

The function module LDAP_SEARCH is marked as obsolete in its documentation. Please use LDAP_READ and your thumbnailphoto should be available in a convenient form to be read from (XSTRING).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM