private String getBindedUserPassword() throws LDAPException { try { return (String) getConn().getEnvironment().get(Context.SECURITY_CREDENTIALS); } catch (NamingException nex) { throw handleNamingException(nex, "Cannot get binded user password."); } }
public ServerDirObjectFactory getObjectFactories( LdapContext ctx ) throws NamingException { Attribute objectClass = ctx.getAttributes( "" ).get( "objectClass" ); if ( objectClass == null ) { return null; } if ( ctx.getEnvironment().containsKey( "factory.hint" ) ) { String oid = ( String ) ctx.getEnvironment().get( "factory.hint" ); String noid = oidRegistry.getOid( oid ); if ( byOid.containsKey( noid ) ) { return ( ServerDirObjectFactory ) byOid.get( noid ); } } // hint did not work or was not provided so we return what we find first for ( int ii = 0; ii < objectClass.size(); ii++ ) { String noid = oidRegistry.getOid( ( String ) objectClass.get( ii ) ); if ( byOid.containsKey( noid ) ) { return ( ServerDirObjectFactory ) byOid.get( noid ); } } return null; }
@Override public String getBindedUserDn() throws LDAPException { if(!isClosed()) { try { return (String) getConn().getEnvironment().get(Context.SECURITY_PRINCIPAL); } catch (NamingException nex) { throw handleNamingException(nex, "Cannot get binded user DN."); } } else { return null; } }
Hashtable<String, String> props = (Hashtable<String, String>) ctx.getEnvironment(); String baseUrl = (String) props.get(Context.PROVIDER_URL); baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));
namingContext = new LdapUrl((String) ctx.getEnvironment().get(Context.PROVIDER_URL)); } catch (LdapURLEncodingException e) { LOGGER.error(e.toString()); String pageSizeStr = (String) ctx.getEnvironment().get("java.naming.ldap.pageSize"); if (pageSizeStr != null) { pageSize = Integer.parseInt(pageSizeStr); sortedBy = (String) ctx.getEnvironment().get("java.naming.ldap.sortedBy"); String recursiveDeleteStr = (String) ctx.getEnvironment().get("java.naming.recursivedelete"); if (recursiveDeleteStr != null) { recursiveDelete = Boolean.parseBoolean(recursiveDeleteStr);
try { final LdapContext ctx = (LdapContext) loopEx.getReferralContext( searchContext.getEnvironment(), config.getControlProcessor().processRequestControls(request.getControls())); search(ctx, request);
try { final LdapContext ctx = (LdapContext) loopEx.getReferralContext( searchContext.getEnvironment(), config.getControlProcessor().processRequestControls(request.getControls())); search(ctx, request);
try { final LdapContext ctx = (LdapContext) loopEx.getReferralContext( searchContext.getEnvironment(), config.getControlProcessor().processRequestControls(request.getControls())); search(ctx, request);
String currentUrl = (String) getConn().getEnvironment().get(Context.PROVIDER_URL); String currentAuth = (String) getConn().getEnvironment().get(Context.SECURITY_AUTHENTICATION); String currentDn = getBindedUserDn();
try Object v = ctx.getEnvironment().get(Context.SECURITY_PROTOCOL); if (v == null) return;
Hashtable env = ldapContext.getEnvironment();