https://github.com/kobatako/elixir_ldap
elixir ldap
https://github.com/kobatako/elixir_ldap
elixir ldap
Last synced: over 1 year ago
JSON representation
elixir ldap
- Host: GitHub
- URL: https://github.com/kobatako/elixir_ldap
- Owner: kobatako
- Created: 2018-02-11T05:28:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-17T23:37:53.000Z (about 8 years ago)
- Last Synced: 2025-02-28T23:22:48.097Z (over 1 year ago)
- Topics: elixir, ldap
- Language: Elixir
- Size: 26.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ElixirLdap
This module LDAP Client for Elixir.
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `elixir_ldap` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:elixir_ldap, "~> 0.2.0"}
]
end
```
## Online documentation
[Hex docuemtn](https://hexdocs.pm/elixir_ldap/api-reference.html)
## Usage
```elixir
handle = ElixirLdap.connect("192.168.11.101")
#=> #PID<0.212.0>
ElixirLdap.Search.search_single_level_all(handle)
#=> {:ok,
#=> [%ElixirLdap.Entry{attributes: [{'objectClass', ['dcObject', 'organization']},
#=> {'dc', ['corporation']}, {'o', ['Corporation Inc']}],
#=> object_name: 'dc=corporation,dc=home,dc=local'}]}
ElixirLdap.Search.search_subtree(handle, [filter: :equal, field: "cn", name: "user01"])
#=> {:ok,
#=> [%ElixirLdap.Entry{attributes: [{'objectClass', ['person']},
#=> {'sn', ['Valentine']}, {'telephoneNumber', ['041 000 000']},
#=> {'cn', ['user01']}],
#=> object_name: 'cn=user01,ou=People,dc=corporation,dc=home,dc=local'}]}
```