Skip to content
Snippets Groups Projects
Commit 16f1363b authored by Barbara B. Frosik's avatar Barbara B. Frosik
Browse files

removed bin directory and LdapConn

parent 3b613133
No related branches found
No related tags found
No related merge requests found
Showing with 0 additions and 124 deletions
### log congiguration
log.file = accountSynchronizer%g.log
log.limit = 6000
log.count = 2
###
### Oracle database settings
###
oracle.database.connection = jdbc:oracle:thin:@ra.aps.anl.gov:1527:aps1
oracle.database.username = glob_conn
### oracle.database.password =
oracle.database.table = DCC.FL$03_BL_APV_VIEW_V2
###
### Postgresql database settings
###
dm.database.connection = jdbc:postgresql://127.0.0.1:11136/dm
dm.database.username = dm
### dm.database.password =
### Connection settings for LDAP
###
#
#ldap.server.address = blacklab.xray.aps.anl.gov
#ldap.server.port = 389
#ldap.server.username = uid=dmadmin,ou=People,o=aps.anl.gov,dc=aps,dc=anl,dc=gov
#ldap.server.password =
###
### LDAP user account settings
###
#ldap.accounts.baseDN = ou=People, o=aps.anl.gov, dc=aps,dc=anl,dc=gov
### General account settings
###
# The user name prefix that gets append to every badge number.
user.userid.prefix = d
File deleted
File deleted
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
firstName = FIRST_NAME
lastName = LAST_NAME
middleName = MIDDLE_NAME
email = EMAIL
badge = BADGE_NO
password = PWD_HASH_VALUE
notEmployee = IS_USRNOT_ANL_EMP
inactive = INACTIVE
recordUpdate = LAST_CHANGE_DATE
package gov.anl.aps.dm.sync;
import com.unboundid.ldap.sdk.BindRequest;
import com.unboundid.ldap.sdk.BindResult;
import com.unboundid.ldap.sdk.LDAPConnection;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.SimpleBindRequest;
import com.unboundid.util.ssl.SSLUtil;
import com.unboundid.util.ssl.TrustAllTrustManager;
import java.security.GeneralSecurityException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.SocketFactory;
public class LdapConn {
LDAPConnection connection = null;
private Logger logger;
public LdapConn(Logger logger) {
this.logger = logger;
}
void connect() {
// Use no key manager, and trust all certificates. This would not be used
// in non-trivial code.
SSLUtil sslUtil = new SSLUtil(null,new TrustAllTrustManager());
SocketFactory socketFactory;
LDAPConnection ldapConnection = null;
try {
// Create the socket factory that will be used to make a secure
// connection to the server.
socketFactory = sslUtil.createSSLSocketFactory();
try {
ldapConnection = new LDAPConnection(socketFactory,"blacklab.xray.aps.anl.gov",636);
System.out.println("seems connected "+ ldapConnection.toString());
} catch (LDAPException ex) {
logger.log(Level.SEVERE, null, ex);
}
} catch(GeneralSecurityException exception) {
System.err.println(exception);
System.exit(1);
}
try {
String dn = "uid=dmadmin,ou=People,o=aps.anl.gov,dc=aps,dc=anl,dc=gov";
String password = "pass";
long maxResponseTimeMillis = 1000;
BindRequest bindRequest = new SimpleBindRequest(dn,password);
bindRequest.setResponseTimeoutMillis(maxResponseTimeMillis);
BindResult bindResult = ldapConnection.bind(bindRequest);
System.out.println("connected to ldap " +bindResult.toString());
} catch(LDAPException ldapException) {
ldapConnection.close();
System.err.println(ldapException);
System.exit(ldapException.getResultCode().intValue());
} }
void close() {
connection.close();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment