@Override public CoreSession getSession() throws Exception { return wrapped.getSession(); }
@Override public CoreSession getSession(LdapPrincipal principal) throws Exception { return wrapped.getSession(principal); }
@Override public CoreSession getSession(Dn principalDn, byte[] credentials) throws LdapException { return wrapped.getSession(principalDn, credentials); }
@Override public CoreSession getSession(Dn principalDn, byte[] credentials, String saslMechanism, String saslAuthId) throws Exception { return wrapped.getSession(principalDn, credentials, saslMechanism, saslAuthId); }
public static CoreSession getCoreSession( String principalDn, DirectoryService service, String dn ) throws LdapException { if ( principalDn == null ) { principalDn = ""; } Dn userDn = new Dn( service.getSchemaManager(), principalDn ); LdapPrincipal principal = new LdapPrincipal( service.getSchemaManager(), userDn, AuthenticationLevel.SIMPLE ); CoreSession session = service.getSession( principal ); return session; }
MultiBaseSearch( String catalogBaseDn, DirectoryService directoryService ) { this.directoryService = directoryService; try { CoreSession session = directoryService.getSession(); catalog = new DnsCatalog( ( Map<String, Object> ) new GetCatalog().execute( session, null ) ); } catch ( Exception e ) { LOG.error( e.getLocalizedMessage(), e ); String message = I18n.err( I18n.ERR_156, catalogBaseDn ); throw new ServiceConfigurationException( message, e ); } }
SingleBaseSearch( String searchBaseDn, DirectoryService directoryService ) { try { CoreSession session = directoryService.getSession(); ctx = new ServerLdapContext( directoryService, session, new LdapName( searchBaseDn ) ); } catch ( Exception e ) { throw new ServiceConfigurationException( I18n.err( I18n.ERR_649, searchBaseDn ), e ); } }
public Set<ResourceRecord> getRecords( QuestionRecord question ) throws DnsException { try { GetRecords getRecords = new GetRecords( question ); String baseDn = catalog.getBaseDn( question.getDomainName() ); CoreSession session = directoryService.getSession(); DirContext dirContext = new ServerLdapContext( directoryService, session, new LdapName( baseDn ) ); return getRecords.execute( dirContext, null ); } catch ( LdapNoSuchObjectException lnnfe ) { LOG.debug( "Name for DNS record search does not exist.", lnnfe ); throw new DnsException( ResponseCode.NAME_ERROR ); } catch ( NamingException ne ) { LOG.error( ne.getLocalizedMessage(), ne ); String message = I18n.err( I18n.ERR_157, question.getDomainName() ); throw new ServiceConfigurationException( message, ne ); } catch ( Exception e ) { LOG.debug( "Unexpected error retrieving DNS records.", e ); throw new DnsException( ResponseCode.SERVER_FAILURE ); } } }
public static LdapContext getContext( String principalDn, DirectoryService service, String dn ) throws Exception { if ( principalDn == null ) { principalDn = ""; } Dn userDn = new Dn( service.getSchemaManager(), principalDn ); LdapPrincipal principal = new LdapPrincipal( service.getSchemaManager(), userDn, AuthenticationLevel.SIMPLE ); if ( dn == null ) { dn = ""; } CoreSession session = service.getSession( principal ); LdapContext ctx = new ServerLdapContext( service, session, new LdapName( dn ) ); return ctx; }
final CoreSession userSession = service.getSession(new Dn(getUserDN(username)), password.getBytes()); final Entry entry = userSession.lookup(new Dn(getUserDN(username))); final User user = getUserFromEntry(entry);
try CoreSession session = service.getSession( principalDn, credential ); ctx = new ServerLdapContext( service, session, new LdapName( providerUrl ) );
coreSession = getLdapServer().getDirectoryService().getSession(); ldapSession.setCoreSession( coreSession );
CoreSession userSession = ds.getSession( ldapPrincipal.getDn(), password, saslMechanism, null );