getting an Base64 encoded attribute from ldap

Hello,

I am having a problem getting a base64 encoded attribute from an ldap
server.=20

When I am doing an ldapsearch from a unix commandline I get the =
attribute
correctly:

QWxhZGRpbjpvcGVuIHNlc2FtZQ=3D=3D

decoding ( decode_base64($encoded) ) it gives me the rigt content

Carlsson Bil =C2erebro AB


When getting it from Ldap using Net::Ldap I get unencryted somthing like
this=20

Carlsson Bil =C2=99erebro=20

I have read nearly everything a could find but didn't anything how to
extract the attribute correctly as a base64 as which it is saved in the
ldap directory.

Can anybody please give me a hint?

Thanx,

Andy


0
Andreas_Kiendl
1/17/2006 10:22:27 AM
perl.ldap 1268 articles. 0 followers. Follow

2 Replies
787 Views

Similar Articles

[PageSpeed] 7

Andreas_Kiendl@msg.de wrote:
> Hello,
> 
> I am having a problem getting a base64 encoded attribute from an ldap
> server. 
> 
> When I am doing an ldapsearch from a unix commandline I get the attribute
> correctly:
> 
> QWxhZGRpbjpvcGVuIHNlc2FtZQ==
> 
> decoding ( decode_base64($encoded) ) it gives me the rigt content
> 
> Carlsson Bil �erebro AB
> 
> 
> When getting it from Ldap using Net::Ldap I get unencryted somthing like
> this 
> 
> Carlsson Bil ™erebro 
> 
> I have read nearly everything a could find but didn't anything how to
> extract the attribute correctly as a base64 as which it is saved in the
> ldap directory.
> 
> Can anybody please give me a hint?
> 

$ENV{LANG} = "C";


--
mike
0
mj
1/17/2006 5:40:06 PM
On 17/1/06 10:22, Andreas_Kiendl@msg.de <Andreas_Kiendl@msg.de> wrote:

> Hello,
>=20
> I am having a problem getting a base64 encoded attribute from an ldap
> server.=20
>=20
> When I am doing an ldapsearch from a unix commandline I get the attribute
> correctly:
>=20
> QWxhZGRpbjpvcGVuIHNlc2FtZQ=3D=3D
>=20
> decoding ( decode_base64($encoded) ) it gives me the rigt content
>=20
> Carlsson Bil =C2erebro AB
>=20
>=20
> When getting it from Ldap using Net::Ldap I get unencryted somthing like
> this=20
>=20
> Carlsson Bil =C2=99erebro
>=20
> I have read nearly everything a could find but didn't anything how to
> extract the attribute correctly as a base64 as which it is saved in the
> ldap directory.
>=20
> Can anybody please give me a hint?

LDAP does *not* encode attribute values using base-64, as it is a binary
protocol. What you are seeing from "ldapsearch" is LDIF output - because
LDIF is a text file format it requires that certain kinds of values be
base-64 encoded *in the file*. For the definition of "certain kinds of
values", see the LDIF spec - RFC 2849. A good approximation is "non-ASCII",
but see the RFC for details.

Net::LDAP returns you the actual attribute value. Perl scalars can hold
binary values, so what you get is what the server sends you. In this case,
an LDAPv3 server should be sending you UTF-8 (or if you're sufficiently
unlucky to be using an LDAPv2 server you should be getting T.61.
Non-conformant LDAPv2 servers will send you ISO-8859-1 instead.)

Cheers,

Chris


0
chrisridd
1/17/2006 6:09:49 PM
Reply:

Similar Artilces:

LDAP attribute Map / LIst / extend the LDAP attributes
we are use ladp on netware 65, is there a list of the LDAP attributes avaliable that are used for eDirectory 8.7? is it possible to create a ldap attribute that contains more that one edirectory attribute content and extend it with a static variable? any ideas HELGE -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Most eDirectory attributes are available natively by their name (minus spaces and special characters). For example fullname works to retrieve the 'Full Name' and givenname works for 'Given Name' and sasloginconfiguration works for 'SAS:...

NET::LDAP, somewhere the new userPassword gets base64 encoded
I'am using the Perl Net::LDAP Module with openldap-2.3.24 (uses LDAP protocol Version 3). I need to update the userPassword field, the problem is that somewhere in the middle the new password i'am giving gets base64 encoded. As to my understanding i'am preparing the whole password. In the password i'am putting first the encoding type: {MD5}, {SSHA}, etc and then the hash. No matter what i do, even the supposed encoding type gets base64 encoded once in the Server. I'am not sure if it is Net::LDAP or the server itself who is doing this: I've tried ...

One or more eDir to LDAP attribute mappings appear to be incorrect. Change attribute mappings through the LDAP
--____IYZLTTEASTICDGWKXZWG____ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Content-Disposition: inline; modification-date="Fri, 6 Nov 2008 16:52:05 +0100" SGkuDQoNClJ1bm5pbmcgWkVOd29ya3MgTWlncmF0aW9uIFV0aWxpdHkgdjEwLjEuMS4wIGFuZCB0 cnlpbmcgdG8gTWlncmF0ZSBBcHBsaWNhdGlvbnMuDQoNCkJ1dCBqdXN0IGdldHMgdGhpcyBFcnJv ci4uLg0KT25lIG9yIG1vcmUgZURpciB0byBMREFQIGF0dHJpYnV0ZSBtYXBwaW5ncyBhcHBlYXIg dG8gYmUgaW5jb3JyZWN0LiBDaGFuZ2UgYXR0cmlidXRlIG1hcHBpbmdzIHRocm91Z2ggdGhlIExE QVAgDQoNCldpdGNoIHNob3VsZCBiZSBmaXhlZCBpbiB2ZXJzaW9uIDEwLjAuMyByZWdhcmRpbmcg dG8gV...

LDAP export
I am trying to do an ldap export of certain user attribute fields, one of them being department. I can not find the ldap attribute mapping for the nds attribute called department. Is there a more extensive list out there, other than the one you see in ConsoleOne? Or does anyone know how the nds attribute: department maps to an ldap attribute? Thanks lhines@flir.com, The NDS attribute for Department is 'OU' and that should map to the LDAP attribute 'ou'. If you need more help with LDAP, please post to the novell.support.ds.ldap forum. -- //N...

Secure LDAP (ldaps)
hi I have implemented ldap authentication in our application using the sample given in "LDAP using EAServer and Powerbuilder" document. It is succefully implemented. But the network people has asked me to connect on secure port (ldaps) now. My problem is i don't know what i kind of setting i should do now on EAServer box and what i should do on the clients. I assume there is nothing to be done on the client because the call to ldap check is initiated from the EAServer Server to LDAP server using EJB (calling JNDI API). We are runnig EAServer on JDK 1.3. Can someone g...

Using /etc/ldap.conf to get hostnames of LDAP servers
Is there a way to get Net::LDAP to use the system configuration file to get the hostnames to connect to? Passing "", undef, or nothing to Net::LDAP->new doesn't seem to do anything other than fail. I could always open the configuration files, but that is slightly painful, given that the first of the vagaries is that it could be /etc/ldap.conf (fedora), /usr/local/etc/ldap.conf (fBSD), or /etc/ldap/ldap.conf (debian). Thanks in advance, Pi -- I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know ...

LDAP
Hello, I found in knowledgebase (TID10096726), that attribute "Server Holds" cannot be read with LDAP. There is recommended delete this attribute. If any user have atrribute "Server Holds", LDAP cannot read user attributes and user cannot login through LDAP. If I removed this attribute by any user object then LDAP can read user attributes and user can login through LDAP. Issue: After any hours server newly created attribute "Server Holds" by any users. This users needs login with LDAP, but this is unpossible, because this atribute "Server Hol...

How do I retrieve operational attributes for an LDAP entry using Net::LDAP?
how do I retrieve the values for 'creatorsName','createTimestamp', 'modifiersName', 'modifyTimestamp' using Net::LDAP module? pleae help ===== use Net::LDAP; use Net::LDAP::Util qw(ldap_error_text ldap_error_name ldap_error_desc); $host='xxxx.com'; $rdn='cn=manager,dc=xxxx,dc=com'; $ldappasswd='123456'; my $ldap=new Net::LDAP($host) or die; my $mesg=$ldap->bind("$rdn",password=>"$ldappasswd",version => 3) or die; my $mesg=$ldap->search(base=>"ou=people,dc=xxxx,dc=com",scope=>...

ldap modify using base64 attribute
Hello! I'm trying to insert an attribute encoding using base64. But I don't know how to tell Net::LDAP that my attribute is in base64. Loading from an LDIF is really easy because you use '::' instead ':' for an attrib. example: dn: mydn name:: RulsaXg= But how can I do that using Net::LDAP?? thanks a lot for your help, Felix PS: please reply this message to my address because I'm not suscribed to the mailing list. Thanks again, -- F�lix Cuello Majorities, of course, start with minorities. -- Robert Mose...

Re: Using /etc/ldap.conf to get hostnames of LDAP servers
> Is there a way to get Net::LDAP to use the system configuration file to > get the hostnames to connect to? Passing "", undef, or nothing to > Net::LDAP->new doesn't seem to do anything other than fail. I could > always open the configuration files, but that is slightly painful, given > that the first of the vagaries is that it could be /etc/ldap.conf > (fedora), /usr/local/etc/ldap.conf (fBSD), or /etc/ldap/ldap.conf > (debian). I use a combination of DNS SRV and TXT records for LDAP service location. Works like a charm, you just need to inclu...

LDAP Query for GroupWise to get mail and nickname attributes
I need to configure some software that uses LDAP to query NDS. I need to be able to read the Mail attribute, as well as find out where in NDS to query the nicknames/alias information. Whether it's in a standard LDAP alias object or it's another attribute in the Users object is totally unclear. Thanks Daniel Danieldn, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might try one of the following options: - Do a search o...

LDAP attributes
Hi, Our company uses a software called Borderware to block Spam emails. Borderware is configured to block the spam emails based on the user's email address. However, some of the users have nick names (Alias names) to receive emails if anyone sends email to their nick name. The problem is, as the Borderware is integrated with LDAP attributes (Maped with NDS attributes), it does not look for the nick names. Borderware says that there is no LDAP attribute to look for nick names. (They use a software called Softerra to browse for the LDAP attributes). So Borderware is not block...

LDAP Attribute
Hey All...first off sorry if this is not the correct forum for this..... Anyways....I have a new WEB server application being developed on a VMS financial system, and it used LDAP to verify access. What it does is send an LDAP request of some sort to a LDAP server with the user ID and password, and then queries the ID for the attibute called "employeeID". If an employee ID is sent back then the login is verified and all is well. But, I cannot figure out how to get an "employeeID" attribute into NDS? I added the DirXML plugins to ConsoleOne, which added a tab c...

eDIR attributes -> LDAP attributes
Hello, we have a software that needs to get some user values like (Department, Telephonenumber...) through LDAP from eDir. I can connect to with LDAP to our OES2 Linux server but I only see some specific attributes like (SN, CN and some other). What should I do that for example telephone and department shows up with LDAP? Thomas -- thsundel ------------------------------------------------------------------------ Thomas, take a look at the ldap group object of that server, there you can add your own attribute mappings in the tab "Attribute Map" for t...

Web resources about - getting an Base64 encoded attribute from ldap - perl.ldap

Attribute - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Template:Attributes of God - Wikipedia, the free encyclopedia
Language: English Română Home Random Template:Attributes of God Part of a series on the Attributes of God Aseity Eternity Graciousness Holiness ...

Six Attributes Of The Perfect Facebook Page Administrator
So, here’s the thing: In many ways, hiring a Facebook page administrator is akin to hiring a poster child for your brand. This trusted manager ...

PANDA: Pose Aligned Networks for Deep Attribute Modeling - Facebook
We propose a method for inferring human attributes (such as gender, hair style, clothes style, expression, action) from images of people under ...

Facebook announces data partnerships to help advertisers target users by offline purchases and attributes ...
... will anonymously match data from consumer loyalty programs with user profiles in order to target ads by offline purchase habits and other attributes. ...

New Study Attributes Rapid Ageing Mainly To Environment Factors
New study explains why some people age faster than others.

Should I use the nofollow attribute on internal links? - YouTube
Regarding "nofollow" on internal links: Does it hurt? Does it help? I read different comments from Matt on this matter over time. What's the ...

Justin Trudeau attributes abortion stance to father's example
Liberal Leader Justin Trudeau says he is following an example set by his famous father when it comes to his position on election candidates and ...

Obama attributes western U.S. wildfires to climate change
... that has burned nearly 400 square miles in the north-central part of Washington state, along with blazes in other Western areas, can be attributed ...

Fifty Shades Of Grey Baby Births: Windsor Hospital Sees Spike In Births, Attribute Book
A significant spike in baby births at a hospital in Windsor, Ontario, has been attributed to the book Fifty Shades of Grey, which has become ...

Resources last updated: 12/27/2015 3:30:39 AM