All Projects → inejge → ldap3

inejge / ldap3

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
A pure-Rust LDAP library using the Tokio stack

Projects that are alternatives of or similar to ldap3

eLdap-Ldap-Search-and-Filter
eLdap is a tool that helps users searching and filtering queries in Ldap environment.
Stars: ✭ 17 (-89.44%)
Mutual labels:  ldap, ldap-client
osprey
Kubernetes OIDC CLI login
Stars: ✭ 49 (-69.57%)
Mutual labels:  ldap
dockerimages
🐳 Some dockerfiles based on alpine
Stars: ✭ 27 (-83.23%)
Mutual labels:  ldap
Recon
HA LDAP based key/value solution for projects configuration storing with multi master replication support
Stars: ✭ 12 (-92.55%)
Mutual labels:  ldap
fix4log4j
No description or website provided.
Stars: ✭ 21 (-86.96%)
Mutual labels:  ldap
caddy-security
🔐 Authentication, Authorization, and Accounting (AAA) App and Plugin for Caddy v2. 💎 Implements Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA/2FA with App Authenticators and Yubico. 💎 Authorization with JWT/PASETO tokens. 🔐
Stars: ✭ 696 (+332.3%)
Mutual labels:  ldap
tsukuyomi
Asynchronous Web framework for Rust
Stars: ✭ 81 (-49.69%)
Mutual labels:  tokio
django-windowsauth
Easy integration and deployment of Django projects into Windows Environments
Stars: ✭ 23 (-85.71%)
Mutual labels:  ldap
wg-portal
WireGuard Configuration Portal with LDAP connection
Stars: ✭ 476 (+195.65%)
Mutual labels:  ldap
ldap-mail-schema
a collection of LDAP mail schemas
Stars: ✭ 36 (-77.64%)
Mutual labels:  ldap
hyper-proxy
A proxy connector for Hyper-based crates
Stars: ✭ 73 (-54.66%)
Mutual labels:  tokio
jax-rs-pac4j
Security library for JAX-RS and Jersey
Stars: ✭ 48 (-70.19%)
Mutual labels:  ldap
pyreports
pyreports is a python library that allows you to create complex report from various sources
Stars: ✭ 78 (-51.55%)
Mutual labels:  ldap
fubuki
Simple VPN implemented using rust
Stars: ✭ 85 (-47.2%)
Mutual labels:  tokio
redap
HTTP-to-LDAP Gateway
Stars: ✭ 27 (-83.23%)
Mutual labels:  ldap
ansible-role-system ldap
Configures SSSD to authenticate against AD's LDAP endpoints
Stars: ✭ 31 (-80.75%)
Mutual labels:  ldap
ldapcontacts
View other LDAP users as contacts in Nextcloud and see the personal data they shared
Stars: ✭ 18 (-88.82%)
Mutual labels:  ldap
tokio-imap
Tokio-based IMAP implementation
Stars: ✭ 110 (-31.68%)
Mutual labels:  tokio
goalie-url-shortener
An implementation of go/ vanity-urls with LDAP support that makes it simple to access internal web assets on a coorporate network.
Stars: ✭ 16 (-90.06%)
Mutual labels:  ldap
person-directory
A framework for resolving persons and attributes from a variety of underlying sources.
Stars: ✭ 26 (-83.85%)
Mutual labels:  ldap

LDAP client library

A pure-Rust LDAP client library using the Tokio stack.

Version notice

New starting with 0.10.3: cross-platform Kerberos/GSSAPI support if compiled with the gssapi feature. This feature enables the use of integrated Windows authentication in Active Directory domains. See the description of the feature in this README for the details of compile-time requirements.

The 0.10 branch gets a dependencies update, move to Edition 2021, and an experimental API update which lets the user pass either owned or borrowed attribute lists. This is a breaking change, especially if you've used or written your own search adapters, although type inference should cover most cases. If the change is too disruptive, the dual attribute list support could be removed in a future release.

The 0.9 branch will only get bug fixes.

Documentation

Note

The library is client-only. One cannot make an LDAP server or a proxy with it. It supports only version 3 of the protocol over connection-oriented transports.

Usage

Add this to your Cargo.toml:

[dependencies.ldap3]
version = "0.10.5"

The library can be used either synchronously or asynchronously. The aim is to offer essentially the same call interface for both flavors, with the necessary differences in interaction and return values according to the nature of I/O.

Examples

The following two examples perform exactly the same operation and should produce identical results. They should be run against the example server in the data subdirectory of the crate source. Other sample programs expecting the same server setup can be found in the examples subdirectory.

Synchronous search

use ldap3::{LdapConn, Scope, SearchEntry};
use ldap3::result::Result;

fn main() -> Result<()> {
    let mut ldap = LdapConn::new("ldap://localhost:2389")?;
    let (rs, _res) = ldap.search(
        "ou=Places,dc=example,dc=org",
        Scope::Subtree,
        "(&(objectClass=locality)(l=ma*))",
        vec!["l"]
    )?.success()?;
    for entry in rs {
        println!("{:?}", SearchEntry::construct(entry));
    }
    Ok(ldap.unbind()?)
}

Asynchronous search

use ldap3::{LdapConnAsync, Scope, SearchEntry};
use ldap3::result::Result;

#[tokio::main]
async fn main() -> Result<()> {
    let (conn, mut ldap) = LdapConnAsync::new("ldap://localhost:2389").await?;
    ldap3::drive!(conn);
    let (rs, _res) = ldap.search(
        "ou=Places,dc=example,dc=org",
        Scope::Subtree,
        "(&(objectClass=locality)(l=ma*))",
        vec!["l"]
    ).await?.success()?;
    for entry in rs {
        println!("{:?}", SearchEntry::construct(entry));
    }
    Ok(ldap.unbind().await?)
}

Compile-time features

The following features are available at compile time:

  • sync (enabled by default): Synchronous API support.

  • gssapi (disabled by default): Kerberos/GSSAPI support. On Windows, system support crates and SDK libraries are used. Elsewhere, the feature needs Clang and its development libraries (for bindgen), as well as the Kerberos development libraries. On Debian/Ubuntu, that means clang-N, libclang-N-dev and libkrb5-dev. It should be clear from these requirements that GSSAPI support uses FFI to C libraries; you should consider the security implications of this fact.

    For usage notes and caveats, see the documentation for Ldap::sasl_gssapi_bind() in the API reference.

  • tls (enabled by default): TLS support, backed by the native-tls crate, which uses a platform-specific TLS backend. This is an alias for tls-native.

  • tls-rustls (disabled by default): TLS support, backed by the Rustls library.

Without any features, only plain TCP connections (and Unix domain sockets on Unix-like platforms) are available. For TLS support, tls and tls-rustls are mutually exclusive: choosing both will produce a compile-time error.

License

Licensed under either of:

at your option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].