Package org.apache.qpid.server.model

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);

        return authenticationProvider;
    }
View Full Code Here


    }

    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

    public static Subject tryToAuthenticate(HttpServletRequest request, HttpManagementConfiguration managementConfig)
    {
        Subject subject = null;
        SocketAddress localAddress = getSocketAddress(request);
        final AuthenticationProvider authenticationProvider = managementConfig.getAuthenticationProvider(localAddress);
        SubjectCreator subjectCreator = authenticationProvider.getSubjectCreator(request.isSecure());
        String remoteUser = request.getRemoteUser();

        if (remoteUser != null || authenticationProvider instanceof AnonymousAuthenticationManager)
        {
            subject = authenticateUser(subjectCreator, remoteUser, null);
        }
        else if(authenticationProvider instanceof ExternalAuthenticationManager
                && Collections.list(request.getAttributeNames()).contains("javax.servlet.request.X509Certificate"))
        {
            Principal principal = null;
            X509Certificate[] certificates =
                    (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
            if(certificates != null && certificates.length != 0)
            {
                principal = certificates[0].getSubjectX500Principal();

                if(!Boolean.valueOf(String.valueOf(authenticationProvider.getAttribute(ExternalAuthenticationManager.ATTRIBUTE_USE_FULL_DN))))
                {
                    String username;
                    String dn = ((X500Principal) principal).getName(X500Principal.RFC2253);

View Full Code Here

        sendJsonResponse(users, request, 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

            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

    }

    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

    public static Subject tryToAuthenticate(HttpServletRequest request, HttpManagementConfiguration managementConfig)
    {
        Subject subject = null;
        SocketAddress localAddress = getSocketAddress(request);
        final AuthenticationProvider authenticationProvider = managementConfig.getAuthenticationProvider(localAddress);
        SubjectCreator subjectCreator = authenticationProvider.getSubjectCreator();
        String remoteUser = request.getRemoteUser();

        if (remoteUser != null || subjectCreator.isAnonymousAuthenticationAllowed())
        {
            subject = authenticateUser(subjectCreator, remoteUser, null);
        }
        else if(subjectCreator.isExternalAuthenticationAllowed()
                && Collections.list(request.getAttributeNames()).contains("javax.servlet.request.X509Certificate"))
        {
            Principal principal = null;
            X509Certificate[] certificates =
                    (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
            if(certificates != null && certificates.length != 0)
            {
                principal = certificates[0].getSubjectX500Principal();

                if(!Boolean.valueOf(String.valueOf(authenticationProvider.getAttribute(ExternalAuthenticationManagerFactory.ATTRIBUTE_USE_FULL_DN))))
                {
                    String username;
                    String dn = ((X500Principal) principal).getName(X500Principal.RFC2253);

View Full Code Here

        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

            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

    }

    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

TOP

Related Classes of org.apache.qpid.server.model.AuthenticationProvider

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.