Package org.springframework.security.core.userdetails

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


        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        handler = new OpenIDAuthenticationFailureHandler();
        postAuthToken = new OpenIDAuthenticationToken(OpenIDAuthenticationStatus.SUCCESS,NON_REGISTERED_OPENID_USER,
            MESSAGE, new ArrayList<OpenIDAttribute>());
        authException = new UsernameNotFoundException("");
}
View Full Code Here


     
      return userDetails;
     
    }catch(EmptyResultDataAccessException e){
      logger.debug("Username: {} not found", username);
      throw new UsernameNotFoundException(username+" not found");
    }
  }
View Full Code Here

     
      return userDetails;
     
    }catch(EmptyResultDataAccessException e){
      logger.debug("Email: {} not found", email);
      throw new UsernameNotFoundException(email+" not found");
    }
  }
View Full Code Here

     
      return userDetails;
     
    }catch(EmptyResultDataAccessException e){
      logger.debug("Email: {} not found", email);
      throw new UsernameNotFoundException(email+" not found");
    }
  }
View Full Code Here

   
    try {
      InternalUser user = this.serviceLocator.getUserService().getUser(username);
      return this.makeUser(user);
    } catch(Exception e) {
      throw new UsernameNotFoundException("User not found: " + username);
    }
  }
View Full Code Here

    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        UserDetails userDetails = null;
        try {
            userDetails = jdbcTemplate.queryForObject(queriesProperties.getProperty("user.get.by.username"), new MapSqlParameterSource("username", username), new UserMapper());
        } catch (EmptyResultDataAccessException e) {
            throw new UsernameNotFoundException(String.format("user '%s' not found", username));
        }

        return userDetails;
    }
View Full Code Here

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
        log.debug("loadUserByUsername called with: {}", username);
        final User user = userRepository.getByUsername(username);
        if (user == null) {
            throw new UsernameNotFoundException("User with username '" + username + "' was not found!");
        }
        return user;
    }
View Full Code Here

    @Override
    public void setAuthenticatedUser(String userId) {
        final User user = userRepository.get(userId);
        if (user == null) {
            throw new UsernameNotFoundException("User with id '" + userId + "' was not found!");
        }
        SecurityContext securityContext = createContext(user);
        SecurityContextHolder.setContext(securityContext);
    }
View Full Code Here

  public UserDetails loadUserDetails(OpenIDAuthenticationToken token) throws UsernameNotFoundException {
    final String openId = token.getIdentityUrl();
    User user = this.getUserByOpenId(openId);
    if (user == null) {
      log.info("Open ID User with URL "+openId+" was not found!");
      throw new UsernameNotFoundException("Open ID User with URL "+openId+" was not found!");
    }
    return user;
  }
View Full Code Here

  public UserDetails loadUserByUsername(String username)
      throws UsernameNotFoundException {
    final Guest guest = JPAUtils.findUnique(em, Guest.class,
        "guest.byUsername", username);
    if (guest == null)
      throw new UsernameNotFoundException(username + " Not Found");
    FlxUserDetails user = new FlxUserDetails(guest);
    return user;
  }
View Full Code Here

TOP

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

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.