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

The following examples show how to use org.springframework.security.ldap.userdetails.LdapUserDetails. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = userDetailsService.loadUserByUsername(authentication.getName());
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #2
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = authentication.getPrincipal();
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #3
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = userDetailsService.loadUserByUsername(authentication.getName());
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #4
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = userDetailsService.loadUserByUsername(authentication.getName());
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #5
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = authentication.getPrincipal();
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #6
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = userDetailsService.loadUserByUsername(authentication.getName());
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #7
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = authentication.getPrincipal();
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #8
Source File: AccountController.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = authentication.getPrincipal();
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #9
Source File: AccountController.java    From maven-framework-project with MIT License 5 votes vote down vote up
@RequestMapping("/accounts/my")
public String view(Model model) {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if(authentication == null) {
        throw new IllegalStateException("authentication cannot be null. Make sure you are logged in.");
    }
    Object principal = authentication.getPrincipal();
    model.addAttribute("user", principal);
    model.addAttribute("isLdapUserDetails", principal instanceof LdapUserDetails);
    model.addAttribute("isLdapPerson", principal instanceof Person);
    model.addAttribute("isLdapInetOrgPerson", principal instanceof InetOrgPerson);
    return "accounts/show";
}
 
Example #10
Source File: GovpayLdapUserDetails.java    From govpay with GNU General Public License v3.0 4 votes vote down vote up
public LdapUserDetails getLdapUserDetails() {
	return ldapUserDetailsImpl;
}
 
Example #11
Source File: GovpayLdapUserDetails.java    From govpay with GNU General Public License v3.0 4 votes vote down vote up
public void setLdapUserDetailsImpl(LdapUserDetails ldapUserDetailsImpl) {
	this.ldapUserDetailsImpl = ldapUserDetailsImpl;
}