Examples of LdapUserDetails


Examples of org.acegisecurity.userdetails.ldap.LdapUserDetails

      if(rollerDetails.getLocale() != null) {
        ud.setLocale(rollerDetails.getLocale());
      }
     
    } else if(userDetails instanceof LdapUserDetails) {
      LdapUserDetails ldapDetails = (LdapUserDetails) userDetails;
      Attributes attributes = ldapDetails.getAttributes();
      String name = getLdapAttribute(attributes, RollerConfig.getProperty(NAME_LDAP_PROPERTY, DEFAULT_NAME_LDAP_ATTRIBUTE));
      String email = getLdapAttribute(attributes, RollerConfig.getProperty(EMAIL_LDAP_PROPERTY, DEFAULT_EMAIL_LDAP_ATTRIBUTE));
     
      ud.setFullName(name);
      ud.setEmailAddress(email);
View Full Code Here

Examples of org.springframework.security.ldap.userdetails.LdapUserDetails

    }

    private User getCurrentUser(Authentication auth, UserManager userManager) {
        User currentUser;
        if (auth.getPrincipal() instanceof LdapUserDetails) {
            LdapUserDetails ldapDetails = (LdapUserDetails) auth.getPrincipal();
            String username = ldapDetails.getUsername();
            currentUser = userManager.getUserByUsername(username);
        } else if (auth.getPrincipal() instanceof UserDetails) {
            currentUser = (User) auth.getPrincipal();
        } else if (auth.getDetails() instanceof UserDetails) {
            currentUser = (User) auth.getDetails();
View Full Code Here

Examples of org.springframework.security.ldap.userdetails.LdapUserDetails

        }

        Object principal = authentication.getPrincipal();

        if (principal instanceof LdapUserDetails) {
            LdapUserDetails details = (LdapUserDetails) principal;
            return details.getDn();
        } else if (authentication instanceof AnonymousAuthenticationToken) {
            if (log.isDebugEnabled()) {
                log.debug("Anonymous Authentication, returning empty String as Principal");
            }
            return "";
View Full Code Here

Examples of org.springframework.security.ldap.userdetails.LdapUserDetails

    @Test
    public void testLoadUserByUsernameReturnsCorrectData() {
        mgr.setUsernameMapper(new DefaultLdapUsernameToDnMapper("ou=people","uid"));
        mgr.setGroupSearchBase("ou=groups");
        LdapUserDetails bob = (LdapUserDetails) mgr.loadUserByUsername("bob");
        assertEquals("bob", bob.getUsername());
        assertEquals("uid=bob,ou=people,dc=springframework,dc=org", bob.getDn());
        assertEquals("bobspassword", bob.getPassword());

        assertEquals(1, bob.getAuthorities().size());
    }
View Full Code Here

Examples of org.springframework.security.userdetails.ldap.LdapUserDetails

                email = rollerDetails.getEmailAddress();
                locale = rollerDetails.getLocale();
                timezone = rollerDetails.getTimeZone();
           
            } else if(userDetails instanceof LdapUserDetails) {
                LdapUserDetails ldapDetails = (LdapUserDetails) userDetails;

                Attributes attributes = ldapDetails.getAttributes();
                screenName = getLdapAttribute(attributes, WebloggerConfig.getProperty(SNAME_LDAP_PROPERTY, DEFAULT_SNAME_LDAP_ATTRIBUTE));
                fullName = getLdapAttribute(attributes, WebloggerConfig.getProperty(NAME_LDAP_PROPERTY, DEFAULT_NAME_LDAP_ATTRIBUTE));
                email = getLdapAttribute(attributes, WebloggerConfig.getProperty(EMAIL_LDAP_PROPERTY, DEFAULT_EMAIL_LDAP_ATTRIBUTE));
                locale = getLdapAttribute(attributes, WebloggerConfig.getProperty(LOCALE_LDAP_PROPERTY, DEFAULT_LOCALE_LDAP_ATTRIBUTE));
                timezone = getLdapAttribute(attributes, WebloggerConfig.getProperty(TIMEZONE_LDAP_PROPERTY, DEFAULT_TIMEZONE_LDAP_ATTRIBUTE));
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.