https://github.com/marschall/site-aware-ldaps-provider
https://github.com/marschall/site-aware-ldaps-provider
java ldap
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marschall/site-aware-ldaps-provider
- Owner: marschall
- Created: 2019-04-27T19:56:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-10T08:48:12.000Z (over 4 years ago)
- Last Synced: 2025-01-16T02:44:48.816Z (4 months ago)
- Topics: java, ldap
- Language: Java
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Site-aware LDAPS Provider
=========================Provides LDAPS site awareness.
* [RFC 2782](https://tools.ietf.org/html/rfc2782) only mentions LDAP and not LDAPS
* Active Directory per default does not create SRV DNS records for LDAPS
* site-awareness is a proprietary Active Directory feature[JDK-8192975](https://bugs.openjdk.java.net/browse/JDK-8192975)
Currently requires the [JNDI DNS client](https://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-dns.html) and Java 12.
Usage
-----Put the JAR in the classpath or module path.
```xml
com.github.marschall
site-aware-ldaps-provider
1.0.0```
```java
Hashtable env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldaps:///dc=example,dc=com"); // ldap also supported
env.put(ActiveDirectoryContext.SITE, "site-name"); // optional
DirContext ctx = new InitialDirContext(env);
```WildFly
-------Dropping the JAR directly in `$JBOSS_HOME/modules` should add it to the Java module path (`-mp`)