Package org.geoserver.security

Examples of org.geoserver.security.GeoServerUserGroupService.loadUserByUsername()


        Collection<GeoServerRole> roles = new ArrayList<GeoServerRole>();
       
        GeoServerUserGroupService service = getSecurityManager().loadUserGroupService(getUserGroupServiceName());
        UserDetails details=null;
        try {
             details = service.loadUserByUsername(principal);
        } catch (UsernameNotFoundException ex) {
            LOGGER.log(Level.WARNING,"User "+ principal + " not found in " + getUserGroupServiceName());
        }
       
        if (details!=null) {
View Full Code Here


        UserDetails details = null;
       
        if (userGroupServiceName!=null) {
            try {
                GeoServerUserGroupService service = getSecurityManager().loadUserGroupService(userGroupServiceName);
                details = service.loadUserByUsername(user);               
                if (details.isEnabled()==false) {
                    log (new DisabledException("User "+user+" is disabled"));
                    return null;
                }
            } catch (IOException ex ) {
View Full Code Here

        String user = m.group(1).replace("\\@", "@");
        String service = m.group(2);

        try {
            GeoServerUserGroupService ugService = securityManager.loadUserGroupService(service);
            return new RememberMeUserDetails(ugService.loadUserByUsername(user),service);
        } catch (IOException e) {
            throw new DataAccessException("Error loading user group service " + service, e) {};
        }
    }
}
View Full Code Here

        GeoServerUserGroupStore store = createStore(service);
        insertValues(store);
        store.store();
       
        String plainpassword = "geoserver";
        UserDetails admin =  service.loadUserByUsername(GeoServerUser.ADMIN_USERNAME);       
        assertFalse(plainpassword.equals(admin.getPassword()));
        UserDetails admin2 =  decService.loadUserByUsername(GeoServerUser.ADMIN_USERNAME);
        assertTrue(plainpassword.equals(admin2.getPassword()));
    }
View Full Code Here

        assertEquals(0,userService.getUserGroups().size());
        assertEquals(0,userService.getGroupCount());
       
        assertEquals(9,roleService.getRoles().size());
       
        GeoServerUser admin = (GeoServerUser) userService.loadUserByUsername("admin");
        assertNotNull(admin);
        GeoServerMultiplexingPasswordEncoder enc= getEncoder(userService);
        assertTrue(enc.isPasswordValid(admin.getPassword(), "gs", null));
       
        assertTrue(admin.isEnabled());
View Full Code Here

        GeoServerMultiplexingPasswordEncoder enc= getEncoder(userService);
        assertTrue(enc.isPasswordValid(admin.getPassword(), "gs", null));
       
        assertTrue(admin.isEnabled());
       
        GeoServerUser wfs = (GeoServerUser) userService.loadUserByUsername("wfs");
        assertNotNull(wfs);
        assertTrue(enc.isPasswordValid(wfs.getPassword(), "webFeatureService", null));
        assertTrue(wfs.isEnabled());

        GeoServerUser disabledUser = (GeoServerUser) userService.loadUserByUsername("disabledUser");
View Full Code Here

        GeoServerUser wfs = (GeoServerUser) userService.loadUserByUsername("wfs");
        assertNotNull(wfs);
        assertTrue(enc.isPasswordValid(wfs.getPassword(), "webFeatureService", null));
        assertTrue(wfs.isEnabled());

        GeoServerUser disabledUser = (GeoServerUser) userService.loadUserByUsername("disabledUser");
        assertNotNull(disabledUser);
        assertTrue(enc.isPasswordValid(disabledUser.getPassword(), "nah", null));
        assertFalse(disabledUser.isEnabled());
       
        GeoServerRole role_admin = roleService.getRoleByName(XMLRoleService.DEFAULT_LOCAL_ADMIN_ROLE);
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.