{"id":18209049,"url":"https://github.com/kdabir/active-directory-lookup","last_synced_at":"2025-04-02T17:32:12.118Z","repository":{"id":3320304,"uuid":"2121889","full_name":"kdabir/active-directory-lookup","owner":"kdabir","description":"Simplest Java API (and CLI) for authenticating and searching in Active Directory","archived":false,"fork":false,"pushed_at":"2023-03-22T23:57:28.000Z","size":190,"stargazers_count":22,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T09:11:22.763Z","etag":null,"topics":["active-directory","authentication","java","search"],"latest_commit_sha":null,"homepage":"https://jitpack.io/com/kdabir/active-directory-lookup/1.0.2/javadoc/","language":"Java","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/kdabir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2011-07-29T02:31:30.000Z","updated_at":"2025-02-24T03:02:55.000Z","dependencies_parsed_at":"2023-01-11T16:16:37.600Z","dependency_job_id":null,"html_url":"https://github.com/kdabir/active-directory-lookup","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdabir%2Factive-directory-lookup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdabir%2Factive-directory-lookup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdabir%2Factive-directory-lookup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdabir%2Factive-directory-lookup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdabir","download_url":"https://codeload.github.com/kdabir/active-directory-lookup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246860176,"owners_count":20845623,"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","authentication","java","search"],"created_at":"2024-11-03T14:03:58.193Z","updated_at":"2025-04-02T17:32:11.806Z","avatar_url":"https://github.com/kdabir.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Active Directory Lookup\n=======================\n\nActive Directory Lookup is an extremely simple Java API to access MS Active Directory for common tasks like user authentication and search. This lightweight library does not depend on any other library (No transitive dependencies) and is merely 17Kb in size. It also provides a minimal [CLI](https://github.com/kdabir/active-directory-lookup/blob/master/src/main/java/io/github/kdabir/adl/cli/ActiveDirectoryCLI.java) for quick operations.\n\n\n## Quick Start\n\nAssuming we know the values of these variables \n\n```java\nString domain;              // e.g. acme.org\nString url;                 // e.g. ldap://somehost.acme.org or ldap://someotherhost.com\nString searchBase;          // e.g. dc=acme,dc=org\nString username;            // e.g. johndoe\nString password;            // e.g. password\n```\n\n### Authenticating with Active Directory\n\n```java\nauthenticator = new ActiveDirectoryAuthenticator(domain, url); // check out other constructors\n    \nauthenticator.authenticate(username, password);\n```\n\n### Searching in Active Directory\n\n```java\nsearcher = new SimpleActiveDirectorySearcher(url, domain, username, password, searchBase);\n\nsearcher.searchByUsername(\"superman\");\n```\n### Building LdapContext\n\n```java\nLdapContext ldapContext = ActiveDirectoryAuthenticator\n                .getDefaultActiveDirectoryBinder()\n                .getLdapContext(url, domain, username, password);\n```\n\n## Installation\n\nThe built library can be consumed directly from jitpack repo\n\n[![Release](https://jitpack.io/v/com.kdabir/active-directory-lookup.svg)](https://jitpack.io/#com.kdabir/active-directory-lookup)\n\n\n### Using Gradle\n\nAdd this at the top of build.gradle\n\n```groovy\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```    \nAdd/merge the dependency in the `dependencies` section    \n\n```groovy\ndependencies {\n    implementation \"com.kdabir:active-directory-lookup:1.0.2\" \n}\n```\n\n### Using Maven\n\nAdd this to the `pom.xml`\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nAdd this to the `dependencies` section within `pom.xml`\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.kdabir\u003c/groupId\u003e\n    \u003cartifactId\u003eactive-directory-lookup\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## API Documentation\n\nBrowse the [JavaDoc](https://jitpack.io/com/kdabir/active-directory-lookup/1.0.2/javadoc/) for \ndetails. The key methods to look out for are: \n  \n- [`ActiveDirectoryAuthenticator::authenticate(..)`](https://jitpack.io/com/kdabir/active-directory-lookup/1.0.2/javadoc/io/github/kdabir/adl/api/ActiveDirectoryAuthenticator.html#authenticate-java.lang.String-java.lang.String-) \n- [`ActiveDirectoryAuthenticator::isValid(..)`](https://jitpack.io/com/kdabir/active-directory-lookup/1.0.2/javadoc/io/github/kdabir/adl/api/ActiveDirectoryAuthenticator.html#isValid-java.lang.String-java.lang.String-)  \n- [`ActiveDirectorySearcher::search(..)`](https://jitpack.io/com/kdabir/active-directory-lookup/1.0.2/javadoc/io/github/kdabir/adl/api/ActiveDirectorySearcher.html#search-io.github.kdabir.adl.api.filters.SearchFilter-)\n- [`SimpleActiveDirectorySearcher::searchByUsername(..)`](https://jitpack.io/com/kdabir/active-directory-lookup/1.0.2/javadoc/io/github/kdabir/adl/api/SimpleActiveDirectorySearcher.html#searchByUsername-java.lang.String-)\n\n## Building Locally\n\nThe project is built and packaged using Gradle.\n\n### Unit Testing\n\n`gradle test`\n\nUnit tests do not depend on any Active Directory instance and hence can be run without any configuration whatsoever.\n\n### Integration Testing\n\n`gradle integrationTests`\n\nYou need to set the `adl.properties` in the root of the project with the right configuration set in order to run Integration\nTests.\n\n### Installing to local Maven repo\n\n`gradle publishToMavenLocal`\n\nThis make's the jar available in you local maven repository for usage.\n\n\n## References :\n\n* http://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-ldap.html\n* http://docs.oracle.com/javase/tutorial/jndi/ops/faq.html\n* http://technet.microsoft.com/en-us/library/aa996205(v=exchg.65).aspx#BasicLDAPSyntax\n\n\n## Finding configuration\n\n\n`nslookup -type=srv _ldap._tcp.DOMAINNAME`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdabir%2Factive-directory-lookup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdabir%2Factive-directory-lookup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdabir%2Factive-directory-lookup/lists"}