LWP::Pr...ol::ldap(3)
π NAME π
okay so this is the LWP::Pr...ol::ldap(3) page from the User Contributed Perl Documentation, and it's literally the manual for LWP::Protocol::ldap β the module that provides LDAP support for LWP::UserAgent. slay π
β¨ SYNOPSIS β¨
Bestie, here's the vibe in code form β copy it exactly, no cap:
use LWP::UserAgent;
$ua = LWP::UserAgent->new();
$res = $ua->get('ldap://ldap.example.com/' .
'o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)',
Accept => 'text/json'):
π¦ DESCRIPTION π¦
The LWP::Protocol::ldap module provides support for using ldap-schemed URLs following RFC 4516 with LWP. This module is a plug-in to the LWP protocol handling, so you don't use it directly. iykyk π«Ά
In addition to being used with LDAP URIs, LWP::Protocol::ldap also acts as the base class for its sibling modules LWP::Protocol::ldaps and LWP::Protocol::ldapi. the way that it's the base class for its siblings is highkey iconic π
π Features π
π HTTP methods supported π
LWP::Protocol::ldap implements the HTTP GET and HEAD methods. They are mapped to the LDAP search operation. periodt β¨
π Response format π
Depending on the HTTP Accept header provided by the user agent, LWP::Protocol::ldap can answer the requests in one of the following formats:
- DSML β When the HTTP Accept header contains the
text/dsmlMIME type, the response is sent as DSMLv1. π - JSON β When the HTTP Accept header contains the
text/jsonMIME type, the response is sent as JSON. For this to work the JSON Perl module needs to be installed. π - LDIF β When the HTTP Accept header contains the
text/ldifMIME type, the response is sent in LDIFv1 format. π - HTML β In case no HTTP Accept header has been sent or none of the above MIME types can be detected, and the
x-formatextension has not been provided either, the response is sent using HTML markup in a 2-column table format (roughly modeled on LDIF). it's giving fallback queen π
As an alternative to sending an HTTP Accept header, LWP::Protocol::ldap also accepts the x-format extension. obsessed with options tbh π
Example:
ldap://ldap.example.com/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)?x-format=dsml
π₯ TLS support π₯
For ldap and ldapi URIs, the module implements the x-tls extension that switches the LDAP connection to TLS using a call of the start_tls method. secure connection era! π
Example:
ldap://ldap.example.com/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)?x-tls=1
Note: In the above example, ideally givingx-tlsshould be sufficient, but unfortunately the parser inURI::ldaphas a little flaw. π not the parser flaw
π«Ά Authorization π«Ά
Usually the connection is done anonymously, but if the HTTP Authorization header is provided with credentials for HTTP Basic authorization, the credentials given in that header will be used to do a simple bind to the LDAP server. authentication lore fr fr π
π SEE ALSO π
LWP::Protocol::ldapsLWP::Protocol::ldapi
go read those too bestie, they're the sibling modules and they ate π¦
π COPYRIGHT π
Copyright (c) 1998-2004 Graham Barr, 2012 Peter Marschall. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. respect the copyright, periodt π
bye bestie π«Ά β signed off with perl v5.42.0, dated 2024-01-02, on the LWP::Pr...ol::ldap(3) manual. π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-ldap 0.68-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms