Package org.apache.directory.studio.connection.core

Examples of org.apache.directory.studio.connection.core.IAuthHandler


            {
                authMethod = AUTHMETHOD_GSSAPI;
            }

            // setup credentials
            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
            if ( authHandler == null )
            {
                NamingException namingException = new NamingException( Messages.model__no_auth_handler );
                monitor.reportError( Messages.model__no_auth_handler, namingException );
                throw namingException;
            }
            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
            if ( credentials == null )
            {
                CancelException cancelException = new CancelException();
                monitor.setCanceled( true );
                monitor.reportError( Messages.model__no_credentials, cancelException );
View Full Code Here


            {
                authMethod = "GSSAPI";
            }

            // setup credentials
            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
            if ( authHandler == null )
            {
                monitor.reportError( Messages.model__no_auth_handler, new Exception() );
            }
            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
            if ( credentials == null )
            {
                monitor.setCanceled( true );
                monitor.reportError( Messages.model__no_credentials, new CancelException() );
                throw new CancelException();
View Full Code Here

            {
                authMethod = "GSSAPI";
            }

            // setup credentials
            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
            if ( authHandler == null )
            {
                monitor.reportError( Messages.model__no_auth_handler, new Exception() );
            }
            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
            if ( credentials == null )
            {
                monitor.setCanceled( true );
                monitor.reportError( Messages.model__no_credentials, new CancelException() );
                throw new CancelException();
View Full Code Here

            {
                authMethod = "GSSAPI";
            }

            // setup credentials
            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
            if ( authHandler == null )
            {
                NamingException namingException = new NamingExceptionMessages.model__no_auth_handler );
                monitor.reportError( Messages.model__no_auth_handler, namingException );
                throw namingException;
            }
            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
            if ( credentials == null )
            {
                CancelException cancelException = new CancelException();
                monitor.setCanceled( true );
                monitor.reportError( Messages.model__no_credentials, cancelException );
View Full Code Here

        StudioProgressMonitor monitor = getProgressMonitor();
        ConnectionParameter connectionParameter = new ConnectionParameter( null, "localhost", ldapServer.getIpPort(),
            EncryptionMethod.NONE, AuthenticationMethod.SIMPLE, "uid=admin,ou=system", "secret", null, true, null );
        Connection connection = new Connection( connectionParameter );
        JNDIConnectionWrapper connectionWrapper = connection.getJNDIConnectionWrapper();
        IAuthHandler authHandler = getAuthHandler();
        ConnectionCorePlugin.getDefault().setAuthHandler( authHandler );

        assertFalse( connectionWrapper.isConnected() );

        connectionWrapper.connect( monitor );
View Full Code Here

    }


    private IAuthHandler getAuthHandler()
    {
        IAuthHandler authHandler = new IAuthHandler()
        {
            public ICredentials getCredentials( ConnectionParameter connectionParameter )
            {
                return new Credentials( connectionParameter.getBindPrincipal(), connectionParameter.getBindPassword(),
                    connectionParameter );
View Full Code Here

            {
                authMethod = "CRAM-MD5";
            }

            // setup credentials
            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
            if ( authHandler == null )
            {
                monitor.reportError( Messages.model__no_auth_handler, new Exception() );
            }
            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
            if ( credentials == null )
            {
                monitor.reportError( Messages.model__no_credentials, new Exception() );
            }
            bindPrincipal = credentials.getBindPrincipal();
View Full Code Here

            {
                authMethod = "CRAM-MD5";
            }

            // setup credentials
            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
            if ( authHandler == null )
            {
                monitor.reportError( Messages.model__no_auth_handler, new Exception() );
            }
            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
            if ( credentials == null )
            {
                monitor.reportError( Messages.model__no_credentials, new Exception() );
            }
            bindPrincipal = credentials.getBindPrincipal();
View Full Code Here

                            bindResponse = ldapConnection.bind( bindRequest );
                        }
                        else
                        {
                            // Setup credentials
                            IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
                            if ( authHandler == null )
                            {
                                Exception exception = new Exception( Messages.model__no_auth_handler );
                                monitor.setCanceled( true );
                                monitor.reportError( Messages.model__no_auth_handler, exception );
                                throw exception;
                            }
                            ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
                            if ( credentials == null )
                            {
                                Exception exception = new Exception();
                                monitor.setCanceled( true );
                                monitor.reportError( Messages.model__no_credentials, exception );
View Full Code Here

                bindCredentials = ""; //$NON-NLS-1$
            }
            else
            {
                // setup credentials
                IAuthHandler authHandler = ConnectionCorePlugin.getDefault().getAuthHandler();
                if ( authHandler == null )
                {
                    NamingException namingException = new NamingException( Messages.model__no_auth_handler );
                    monitor.reportError( Messages.model__no_auth_handler, namingException );
                    throw namingException;
                }
                ICredentials credentials = authHandler.getCredentials( connection.getConnectionParameter() );
                if ( credentials == null )
                {
                    CancelException cancelException = new CancelException();
                    monitor.setCanceled( true );
                    monitor.reportError( Messages.model__no_credentials, cancelException );
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.connection.core.IAuthHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.