Examples of AuthenticationProvider


Examples of org.apache.qpid.server.model.AuthenticationProvider

    }

    protected AuthenticationProvider findAuthenticationProviderByName(String providerName, Collection<AuthenticationProvider> authenticationProviders)
    {
        AuthenticationProvider provider = null;
        for (AuthenticationProvider authenticationProvider : authenticationProviders)
        {
            if(authenticationProvider.getName().equals(providerName))
            {
                provider = authenticationProvider;
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

    }

    private PreferencesProvider getPreferencesProvider(HttpServletRequest request)
    {
        SocketAddress localAddress = HttpManagementUtil.getSocketAddress(request);
        AuthenticationProvider authenticationProvider = getManagementConfiguration().getAuthenticationProvider(localAddress);
        if (authenticationProvider == null)
        {
            throw new IllegalStateException("Authentication provider is not found");
        }
        return authenticationProvider.getPreferencesProvider();
    }
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

    }

    public void testCreateBrokerWithMultipleAuthenticationProvidersAndPorts()
    {
        //Create a second authentication provider
        AuthenticationProvider authenticationProvider2 = mock(AuthenticationProvider.class);
        when(authenticationProvider2.getName()).thenReturn("authenticationProvider2");
        ConfigurationEntry authenticationProviderEntry2 = mock(ConfigurationEntry.class);
        _brokerEntryChildren.put(AuthenticationProvider.class.getSimpleName(), Arrays.asList(_authenticationProviderEntry1, authenticationProviderEntry2));

        //Add a couple ports
        ConfigurationEntry portEntry1 = mock(ConfigurationEntry.class);
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

            ConfigurationEntry authenticationProviderEntry = new ConfigurationEntry(authenticationId,
                    AuthenticationProvider.class.getSimpleName(), authenticationAttributes, Collections.singleton(preferencesId),
                    _configurationStore);
            try
            {
                AuthenticationProvider authenticationProvider = _recoverer.create(recovererProvider, authenticationProviderEntry,
                        _broker);
                assertNotNull("Authentication provider was not recovered", authenticationProvider);
                assertEquals("Unexpected name", "test-authenticator", authenticationProvider.getName());
                assertEquals("Unexpected id", authenticationId, authenticationProvider.getId());
                PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
                assertNotNull("Preferences provider was not recovered", preferencesProvider);
                assertEquals("Unexpected path", file.getAbsolutePath(),
                        preferencesProvider.getAttribute(FileSystemPreferencesProvider.PATH));
            }
            finally
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

                Collections.singleton(authenticationManagerFactory));
        when(authenticationManagerFactory.createInstance(broker, attributes)).thenReturn(authenticationManager);

        AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(authManagerFactoryServiceLoader);

        AuthenticationProvider provider = null;
        if (create)
        {
            provider = providerFactory.create(id, broker, attributes);
        }
        else
        {
            provider = providerFactory.recover(id, attributes, broker);
        }

        assertNotNull("Provider is not created", provider);
        assertEquals("Unexpected ID", id, provider.getId());

        return provider;
    }
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

        when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));

        AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader);

        UUID randomUUID = UUID.randomUUID();
        AuthenticationProvider provider = providerFactory.create(randomUUID, broker, new HashMap<String, Object>());

        assertNotNull("Provider is not created", provider);
        assertEquals("Unexpected ID", randomUUID, provider.getId());
    }
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

    @SuppressWarnings("unchecked")
    public void testCreateNonPasswordCredentialManagingAuthenticationProviderWhenAnotherOneAlreadyExist()
    {
        Broker broker = mock(Broker.class);
        AuthenticationProvider anotherProvider = mock(AuthenticationProvider.class);
        when(broker.getAuthenticationProviders()).thenReturn(Collections.singleton(anotherProvider));

        QpidServiceLoader<AuthenticationManagerFactory> loader = mock(QpidServiceLoader.class);
        AuthenticationManagerFactory managerFactory = mock(AuthenticationManagerFactory.class);
        when(managerFactory.createInstance(any(Broker.class), any(Map.class))).thenReturn(mock(AuthenticationManager.class));
        when(loader.atLeastOneInstanceOf(AuthenticationManagerFactory.class)).thenReturn(Collections.singleton(managerFactory));

        AuthenticationProviderFactory providerFactory = new AuthenticationProviderFactory(loader);
        UUID id = UUID.randomUUID();
        AuthenticationProvider provider = providerFactory.create(id, broker, new HashMap<String, Object>());

        assertNotNull("Provider is not created", provider);
        assertEquals("Unexpected ID", id, provider.getId());
    }
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

        _supportedBrokerStoreTypes = new BrokerConfigurationStoreCreator().getStoreTypes();
        _brokerStore = brokerStore;
        if (_brokerOptions.isManagementMode())
        {
            AuthenticationManager authManager = new SimpleAuthenticationManager(BrokerOptions.MANAGEMENT_MODE_USER_NAME, _brokerOptions.getManagementModePassword());
            AuthenticationProvider authenticationProvider = new SimpleAuthenticationProviderAdapter(UUID.randomUUID(), this,
                    authManager, Collections.<String, Object> emptyMap(), Collections.<String> emptySet());
            _managementAuthenticationProvider = authenticationProvider;
        }
    }
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

        return removedAccessControlProvider != null;
    }

    private AuthenticationProvider createAuthenticationProvider(Map<String, Object> attributes)
    {
        AuthenticationProvider authenticationProvider = _authenticationProviderFactory.create(UUID.randomUUID(), this, attributes);
        authenticationProvider.setDesiredState(State.INITIALISING, State.ACTIVE);
        addAuthenticationProvider(authenticationProvider);
        return authenticationProvider;
    }
View Full Code Here

Examples of org.apache.qpid.server.model.AuthenticationProvider

        return removedPort != null;
    }

    private boolean deleteAuthenticationProvider(AuthenticationProvider authenticationProvider)
    {
        AuthenticationProvider removedAuthenticationProvider = null;
        synchronized (_authenticationProviders)
        {
            removedAuthenticationProvider = _authenticationProviders.remove(authenticationProvider.getId());
        }

        if(removedAuthenticationProvider != null)
        {
            removedAuthenticationProvider.removeChangeListener(this);
        }

        return removedAuthenticationProvider != null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.