Package org.springframework.security.core.userdetails

Examples of org.springframework.security.core.userdetails.User


        /**
         * Creates a new {@link User}
         * @return the {@link User} for the principal
         */
        private User createUser() {
            return new User(username, password, enabled, accountNonExpired,
                    credentialsNonExpired, accountNonLocked, authorities);
        }
View Full Code Here


            this.disabled = disabled;
            return this;
        }

        private UserDetails build() {
            return new User(username, password, !disabled, !accountExpired,
                    !credentialsExpired, !accountLocked, authorities);
        }
View Full Code Here

        provider.afterPropertiesSet();
    }

    static class MockUserDetailsService implements UserDetailsService {
        public UserDetails loadUserByUsername(String ssoUserId) throws AuthenticationException {
            return new User(ssoUserId, "password", true, true, true, true,
                    AuthorityUtils.createAuthorityList("ROLE_A", "ROLE_B"));
        }
View Full Code Here

                grantedAuthorities.add(new SimpleGrantedAuthority(this.convertToUpperCase ? value.toString().toUpperCase() : value.toString()));
            }

        }

        return new User(assertion.getPrincipal().getName(), NON_EXISTENT_PASSWORD_VALUE, true, true, true, true, grantedAuthorities);
    }
View Full Code Here

*/
@SuppressWarnings("deprecation")
public class UserMapTests {
    @Test
    public void testAddAndRetrieveUser() {
        UserDetails rod = new User("rod", "koala", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE","ROLE_TWO"));
        UserDetails scott = new User("scott", "wombat", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE","ROLE_THREE"));
        UserDetails peter = new User("peter", "opal", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE","ROLE_FOUR"));
        UserMap map = new UserMap();
        map.addUser(rod);
        map.addUser(scott);
        map.addUser(peter);
View Full Code Here

        }
    }

    @Test
    public void unknownUserIsNotRetrieved() {
        UserDetails rod = new User("rod", "koala", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE","ROLE_TWO"));
        UserMap map = new UserMap();
        assertEquals(0, map.getUserCount());
        map.addUser(rod);
        assertEquals(1, map.getUserCount());
View Full Code Here

        return cache;
    }

    private User getUser() {
        return new User("john", "password", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));
    }
View Full Code Here

        cache.clear();
        return cache;
    }

    private User getUser() {
        return new User("john", "password", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));
    }
View Full Code Here

public class NullUserCacheTests extends TestCase {

    //~ Methods ========================================================================================================

    private User getUser() {
        return new User("john", "password", true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO"));
    }
View Full Code Here

        assertThat(resolver.resolveArgument(showUserAnnotationObject(), null)).isEqualTo(expectedPrincipal);
    }

    @Test
    public void resolveArgumentUserDetails() throws Exception {
        setAuthenticationPrincipal(new User("user", "password", AuthorityUtils.createAuthorityList("ROLE_USER")));
        assertThat(resolver.resolveArgument(showUserAnnotationUserDetails(), null)).isEqualTo(expectedPrincipal);
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.core.userdetails.User

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.