Accessing LDAP jpegPhoto attribute in Ruby...

Discussion in 'Ruby' started by augustf@gmail.com, Sep 22, 2006.

  1. Guest

    Hi everyone,
    In writing my Ruby LDAP application, I'm able (with activeldap) to
    access any ldap attribute I need - except binary ones. user.uid, for
    instance would get me the userid of the user. But user.jpegPhoto yields
    binary rubbish.

    The excellent documentation for active ldap
    (http://ruby-activeldap.rubyforge.org/doc/) showed how to access a
    userCertificate like so: user.userCertificate = {'binary' =>
    File.read('example.der')} . I'm unable to replicate something
    comparable for jpegPhoto. Anyone know how I can display the jpegPhoto
    attribute properly?
    , Sep 22, 2006
    #1
    1. Advertising

  2. On 9/22/06, <> wrote:
    > Hi everyone,
    > In writing my Ruby LDAP application, I'm able (with activeldap) to
    > access any ldap attribute I need - except binary ones. user.uid, for
    > instance would get me the userid of the user. But user.jpegPhoto yields
    > binary rubbish.
    >


    Have you tried querying this attribute with the Net::LDAP library? It
    recently acquired some significant improvements in how it handles
    binary attributes. I can tell you from my own research that some
    versions of the native-code LDAP libraries (which Ruby/LDAP and
    ActiveLDAP are based on) have some possibly incorrect behavior with
    regard to binary values.
    Francis Cianfrocca, Sep 22, 2006
    #2
    1. Advertising

  3. Guest

    Sorry to impose further, but I'm a relative newbie to Ruby - what would
    be the general sort of syntax needed in this situation?


    Francis Cianfrocca wrote:
    > On 9/22/06, <> wrote:
    > > Hi everyone,
    > > In writing my Ruby LDAP application, I'm able (with activeldap) to
    > > access any ldap attribute I need - except binary ones. user.uid, for
    > > instance would get me the userid of the user. But user.jpegPhoto yields
    > > binary rubbish.
    > >

    >
    > Have you tried querying this attribute with the Net::LDAP library? It
    > recently acquired some significant improvements in how it handles
    > binary attributes. I can tell you from my own research that some
    > versions of the native-code LDAP libraries (which Ruby/LDAP and
    > ActiveLDAP are based on) have some possibly incorrect behavior with
    > regard to binary values.
    , Sep 22, 2006
    #3
  4. On 9/22/06, <> wrote:
    > Sorry to impose further, but I'm a relative newbie to Ruby - what would
    > be the general sort of syntax needed in this situation?
    >


    I'll contact you privately. Then if this succeeds we'll post the
    results to the list.
    Francis Cianfrocca, Sep 22, 2006
    #4
  5. Guest

    Since my last post, I've made some significant progress on this
    problem, but am still stuck with some non-workable code. Have a look:
    http://p.caboo.se/16721 Thanks everyone!
    , Oct 10, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Wold

    using LDAP Controls in ruby-ldap

    Jason Wold, Nov 4, 2004, in forum: Ruby
    Replies:
    5
    Views:
    241
  2. Ian Macdonald
    Replies:
    0
    Views:
    216
    Ian Macdonald
    Mar 15, 2005
  3. James Hughes
    Replies:
    4
    Views:
    325
    James Hughes
    Dec 13, 2005
  4. Replies:
    1
    Views:
    205
    Austin Ziegler
    Oct 11, 2006
  5. dacat

    Net::LDAP vs ruby/ldap

    dacat, Apr 27, 2007, in forum: Ruby
    Replies:
    3
    Views:
    294
    Ian Macdonald
    May 18, 2007
Loading...

Share This Page