Examples of AuthenticationProvider


Examples of org.apache.jetspeed.security.AuthenticationProvider

    {
        Set publicCredentials = new HashSet();
        String providerName = getAuthenticationProvider(username);
        if ( providerName != null )
        {
            AuthenticationProvider provider = getAuthenticationProviderByName(providerName);
            publicCredentials.addAll(provider.getCredentialHandler().getPublicCredentials(username));
        }
        return publicCredentials;
    }
View Full Code Here

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

{

    public void testCreatePasswordCredentialManagingAuthenticationProvider()
    {
        AuthenticationManager am = mock(PrincipalDatabaseAuthenticationManager.class);
        AuthenticationProvider provider = testForFactory(am, true);
        assertTrue("The created provider should match the factory's AuthenticationManager type",
                provider instanceof PasswordCredentialManagingAuthenticationProvider);
        verify(am).onCreate();
    }
View Full Code Here

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

    }

    public void testCreateNonPasswordCredentialManagingAuthenticationProvider()
    {
        AuthenticationManager am = mock(AuthenticationManager.class);
        AuthenticationProvider provider = testForFactory(am, true);
        assertFalse("The created provider should match the factory's AuthenticationManager type",
                provider instanceof PasswordCredentialManagingAuthenticationProvider);
        verify(am).onCreate();
    }
View Full Code Here

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

    }

    public void testRecoverPasswordCredentialManagingAuthenticationProvider()
    {
        AuthenticationManager am = mock(PrincipalDatabaseAuthenticationManager.class);
        AuthenticationProvider provider = testForFactory(am, false);
        assertTrue("The created provider should match the factory's AuthenticationManager type",
                provider instanceof PasswordCredentialManagingAuthenticationProvider);
        verify(am, never()).onCreate();
    }
View Full Code Here

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

    }

    public void testRecoverNonPasswordCredentialManagingAuthenticationProvider()
    {
        AuthenticationManager am = mock(AuthenticationManager.class);
        AuthenticationProvider provider = testForFactory(am, false);
        assertFalse("The created provider should match the factory's AuthenticationManager type",
                provider instanceof PasswordCredentialManagingAuthenticationProvider);
        verify(am, never()).onCreate();
    }
View Full Code Here

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

    }

    public void testGetAuthenticationProvider()
    {
        SocketAddress localAddress = InetSocketAddress.createUnresolved("localhost", 8080);
        AuthenticationProvider brokerAuthenticationProvider = mock(AuthenticationProvider.class);
        when(_broker.getAuthenticationProvider(localAddress)).thenReturn(brokerAuthenticationProvider);
        AuthenticationProvider authenticationProvider = _management.getAuthenticationProvider(localAddress);
        assertEquals("Unexpected subject creator", brokerAuthenticationProvider, authenticationProvider);
    }
View Full Code Here

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

    @Override
    public AuthenticationProvider create(RecovererProvider recovererProvider, ConfigurationEntry configurationEntry, ConfiguredObject... parents)
    {
        Broker broker = RecovererHelper.verifyOnlyBrokerIsParent(parents);
        Map<String, Object> attributes = configurationEntry.getAttributes();
        AuthenticationProvider authenticationProvider = _authenticationProviderFactory.recover(configurationEntry.getId(), attributes, broker);

        Map<String, Collection<ConfigurationEntry>> childEntries = configurationEntry.getChildren();

        for (String type : childEntries.keySet())
        {
View Full Code Here

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

    @Override
    public PreferencesProvider create(RecovererProvider recovererProvider, ConfigurationEntry entry,
            ConfiguredObject... parents)
    {
        AuthenticationProvider authenticationProvider = RecovererHelper.verifyOnlyParentIsOfType(AuthenticationProvider.class, parents);
        Map<String, Object> attributes = entry.getAttributes();
        String type = MapValueConverter.getStringAttribute(PreferencesProvider.TYPE, attributes);
        PreferencesProviderFactory factory = PreferencesProviderFactory.FACTORIES.get(type);
        return factory.createInstance(entry.getId(), attributes, authenticationProvider);
    }
View Full Code Here

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

        sendJsonResponse(users, response);
    }

    private PreferencesProvider getPreferencesProvider(String authenticationProviderName)
    {
        AuthenticationProvider authenticationProvider = getAuthenticationProvider(authenticationProviderName);
        if (authenticationProvider == null)
        {
            throw new IllegalArgumentException(String.format("Authentication provider '%s' is not found",
                    authenticationProviderName));
        }
        PreferencesProvider preferencesProvider = authenticationProvider.getPreferencesProvider();
        return preferencesProvider;
    }
View Full Code Here

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

            String providerName =  elements[0];
            Set<String> users = providerUsers.get(providerName);

            if (users == null)
            {
                AuthenticationProvider provider = findAuthenticationProviderByName(providerName, authenticationProviders);
                if (provider == null)
                {
                    throw new IllegalArgumentException("Cannot find provider with name '" + providerName + "'");
                }
                users = new HashSet<String>();
                providerUsers.put(providerName, users);
                requestProviders.put(providerName, provider);
            }
            users.add(userId);
        }

        if (!providerUsers.isEmpty())
        {
            for (Map.Entry<String, Set<String>> entry : providerUsers.entrySet())
            {
                String providerName = entry.getKey();
                AuthenticationProvider provider = requestProviders.get(providerName);
                Set<String> usersToDelete = entry.getValue();
                PreferencesProvider preferencesProvider = provider.getPreferencesProvider();

                if (preferencesProvider != null && !usersToDelete.isEmpty())
                {
                    String[] users = usersToDelete.toArray(new String[usersToDelete.size()]);
                    preferencesProvider.deletePreferences(users);
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.