Package org.geoserver.security.ldap

Examples of org.geoserver.security.ldap.LDAPSecurityProvider


                        if (ldapConfig.getUserDnPattern() == null && ldapConfig.getUserFilter() == null) {
                            error("Neither user dn pattern or user filter specified");
                            return;
                        }
                       
                        LDAPSecurityProvider provider = new LDAPSecurityProvider(getSecurityManager());
                        LDAPAuthenticationProvider authProvider = (LDAPAuthenticationProvider) provider
                                .createAuthenticationProvider(ldapConfig);
                        Authentication authentication = authProvider
                                .authenticate(new UsernamePasswordAuthenticationToken(
                                        username, password));
                        if(authentication == null || !authentication.isAuthenticated()) {
                            throw new AuthenticationException("Cannot authenticate " + username);
                        }

                        provider.destroy(null);
                        info(new StringResourceModel(LDAPAuthProviderPanel.class.getSimpleName() +
                            ".connectionSuccessful", null).getObject());
                    } catch (Exception e) {
                        error(e);
                        LOGGER.log(Level.WARNING, e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.geoserver.security.ldap.LDAPSecurityProvider

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.