{"id":13508618,"url":"https://github.com/jmerriweather/exldap","last_synced_at":"2025-04-09T23:19:13.683Z","repository":{"id":47034579,"uuid":"45881191","full_name":"jmerriweather/exldap","owner":"jmerriweather","description":"A module for working with LDAP from Elixir","archived":false,"fork":false,"pushed_at":"2021-09-16T11:35:53.000Z","size":48,"stargazers_count":59,"open_issues_count":4,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T16:50:58.039Z","etag":null,"topics":["active-directory","elixir","ldap"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmerriweather.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-10T02:11:45.000Z","updated_at":"2024-01-26T14:58:06.000Z","dependencies_parsed_at":"2022-09-23T10:53:29.776Z","dependency_job_id":null,"html_url":"https://github.com/jmerriweather/exldap","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmerriweather%2Fexldap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmerriweather%2Fexldap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmerriweather%2Fexldap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmerriweather%2Fexldap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmerriweather","download_url":"https://codeload.github.com/jmerriweather/exldap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125717,"owners_count":21051789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-directory","elixir","ldap"],"created_at":"2024-08-01T02:00:55.683Z","updated_at":"2025-04-09T23:19:13.658Z","avatar_url":"https://github.com/jmerriweather.png","language":"Elixir","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"# Exldap\r\n\r\nA module for working with LDAP from Elixir\r\n\r\n## Installation\r\n\r\nThe package can be installed as:\r\n\r\n  1. Add exldap to your list of dependencies in `mix.exs`:\r\n```elixir\r\n        def deps do\r\n          [{:exldap, \"~\u003e 0.6\"}]\r\n        end\r\n```\r\n  2. Ensure exldap is started before your application:\r\n```elixir\r\n        def application do\r\n          [applications: [:exldap]]\r\n        end\r\n```\r\n  3. Optionally add 'config\\config.secret.exs' file with:\r\n```elixir\r\n        use Mix.Config\r\n\r\n        config :exldap, :settings,\r\n          server: \u003cserver address\u003e,\r\n          base: \"DC=example,DC=com\",\r\n          port: 636,\r\n          ssl: true,\r\n          user_dn: \u003cuser distinguished name\u003e,\r\n          password: \u003cpassword\u003e,\r\n          search_timeout: 1000 # optionally set a search timeout in milliseconds, default is infinity\r\n```\r\n### Usage with configuration set in config.exs\r\n\r\n```elixir\r\n# the default_timeout is infinity\r\n\r\n{:ok, connection} = Exldap.connect(TIMEOUT \\\\ default_timeout) # optionally set the maximum time in milliseconds that each server request may take\r\n\r\n{:ok, search_results} = Exldap.search_field(connection, \"cn\", \"test123\")\r\n\r\n{:ok, first_result} = search_results |\u003e Enum.fetch(0)\r\n\r\nresult = Exldap.search_attributes(first_result, \"displayName\")\r\n\r\n\r\n```\r\n\r\n### Usage without configuration\r\n\r\n```elixir\r\n# the default_timeout is infinity\r\n\r\n{:ok, connection} = Exldap.connect(\"SERVERADDRESS\", 636, true, \"CN=test123,OU=Accounts,DC=example,DC=com\", \"PASSWORD\", TIMEOUT \\\\ default_timeout)\r\n\r\n{:ok, search_results} = Exldap.search_field(connection, \"OU=Accounts,DC=example,DC=com\", \"cn\", \"useraccount\")\r\n\r\n{:ok, first_result} = search_results |\u003e Enum.fetch(0)\r\n\r\nresult = Exldap.search_attributes(first_result, \"displayName\")\r\n\r\n```\r\n\r\n### Verify credentials with configuration set in config.exs\r\n\r\n```elixir\r\n# the default_timeout is infinity\r\n\r\n{:ok, connection} = Exldap.open(TIMEOUT \\\\ default_timeout) # optionally set the maximum time in milliseconds that each server request may take\r\n\r\ncase Exldap.verify_credentials(connection, \"CN=test123,OU=Accounts,DC=example,DC=com\", \"PASSWORD\") do\r\n  :ok -\u003e IO.puts \"Successfully connected\"\r\n  _ -\u003e IO.puts \"Failed to connect\"\r\nend\r\n\r\n```\r\n\r\n### Verify credentials without configuration\r\n\r\n```elixir\r\n\r\n# the default_timeout is infinity\r\n\r\n{:ok, connection} = Exldap.open(\"SERVERADDRESS\", 636, true, TIMEOUT \\\\ default_timeout)\r\n\r\ncase Exldap.verify_credentials(connection, \"CN=test123,OU=Accounts,DC=example,DC=com\", \"PASSWORD\") do\r\n  :ok -\u003e IO.puts \"Successfully connected\"\r\n  _ -\u003e IO.puts \"Failed to connect\"\r\nend\r\n\r\n```\r\n\r\n### Use SSL, validating certificates, from configuration\r\n\r\n```elixir \r\n        use Mix.Config\r\n\r\n        config :exldap, :settings,\r\n          server: \u003cserver address\u003e,\r\n          base: \"DC=example,DC=com\",\r\n          port: 636,\r\n          ssl: true,\r\n          sslopts: [cacertfile: 'path/to/ca.pem', verify: verify_peer]\r\n          user_dn: \u003cuser distinguished name\u003e,\r\n          password: \u003cpassword\u003e,\r\n          search_timeout: 1000\r\n```\r\n\r\n### Use SSL, validating certificates, from configuration\r\n\r\n```elixir \r\n        sslopts=[cacertfile: 'path/to/ca.pem', verify: verify_peer]\r\n        {:ok, connection} = Exldap.connect(\"SERVERADDRESS\", 636, true, \"CN=test123,OU=Accounts,DC=example,DC=com\", \"PASSWORD\", timeout, sslopts)\r\n        ...\r\n\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmerriweather%2Fexldap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmerriweather%2Fexldap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmerriweather%2Fexldap/lists"}