Package org.springframework.security.userdetails

Examples of org.springframework.security.userdetails.UserDetails


     * {@inheritDoc}
     */
    public Authentication authenticate(final Authentication authentication)
    {
        UsernamePasswordAuthenticationToken userToken = (UsernamePasswordAuthenticationToken) authentication;
        UserDetails currentUserDets = userDetailsService.loadUserByUsername(userToken.getName());
        userDetailsChecker.check(currentUserDets);
        return new UsernamePasswordAuthenticationToken(currentUserDets, userToken.getCredentials(),
                currentUserDets.getAuthorities());
    }
View Full Code Here


     * @return the action response encapsulated with the request
     */
    @SuppressWarnings({ "rawtypes" })
    public final ActionRequest execute(final ActionRequest request)
    {
        UserDetails user = getUserDetails();
        return execute(request, user);
    }
View Full Code Here

     * @return the action response encapsulated with the request
     */
    @SuppressWarnings({ "rawtypes" })
    public final ActionRequest[] execute(final ActionRequest[] requests)
    {
        UserDetails user = getUserDetails();

        ActionRequest[] results = new ActionRequest[requests.length];
        for (int i = 0; i < requests.length; i++)
        {
            results[i] = execute(requests[i], user);
View Full Code Here

     *
     * @return represents the user currently in session
     */
    private UserDetails getUserDetails()
    {
        UserDetails user = null;
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();

        if (null != auth)
        {
            Object obj = auth.getPrincipal();
            if (obj instanceof UserDetails)
            {
                user = (UserDetails) obj;
                log.debug("Found username: " + user.getUsername());
            }
        }

        if (null == user)
        {
View Full Code Here

            }

            Object obj = auth.getPrincipal();
            if (obj instanceof UserDetails)
            {
                UserDetails user = (UserDetails) obj;
                ExtendedUserDetails extUser = (ExtendedUserDetails) user;
                return new DefaultPrincipal(extUser.getUsername(), extUser.getPerson().getOpenSocialId(), extUser
                        .getPerson().getId());
            }
            else
View Full Code Here

            return null;
        }

        // load user details.
        log.debug("loading userDetails for user: " + parentAuthResult.getName());
        UserDetails details = userDetailsService
                .loadUserByUsername((String) parentAuthResult.getName());
       
        detailsChecker.check(details);
       
        //return new Authentication object with UserDetails populated.
View Full Code Here

     * @return A populated UserDetails object.
     */
    public UserDetails mapUserFromContext(final DirContextOperations context,
            final String username, final GrantedAuthority[] authority)
    {
        UserDetails userDetails = userDetailsService.loadUserByUsername(username);
        detailsChecker.check(userDetails);
        return userDetails;
    }
View Full Code Here

        final User user = getDirectoryManager().getUserByUsername(username);
        if (user == null) {
            throw new UsernameNotFoundException(username);
        }

        UserDetails details = new WorkflowUserDetails(user);
        return details;
    }
View Full Code Here

        }
        GrantedAuthority[] authorities = gaList.toArray(new GrantedAuthority[gaList.size()]);

        // return result
        User user = directoryManager.getUserByUsername(username);
        UserDetails details = new WorkflowUserDetails(user);
        UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken(details, password, authorities);
        result.setDetails(details);
        return result;
    }
View Full Code Here

        boolean isEnabled = ftpUser.getEnabled();
        GrantedAuthority[] authorities = new GrantedAuthority[0];
        boolean accountNonExpired = true;
        boolean credentialsNonExpired = true;
        boolean accountNonLocked = true;
        UserDetails userDetails = new org.springframework.security.userdetails.User(username,
                password, isEnabled, accountNonExpired, credentialsNonExpired, accountNonLocked,
                authorities);

        return userDetails;
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.userdetails.UserDetails

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.