Package org.springframework.security.core.userdetails

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


    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 수정시 [쓰기권한]이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleWrite == "") throw new UsernameNotFoundException("내용 수정시 접근한 게시판에 Read 권한이 존재하지않습니다.");

    // 게시판 정보
    Article article = boardBO.viewArticle(new Integer(atcNo));
    article.setModIp(request.getRemoteAddr());
View Full Code Here


    } else {
      strRoleRead = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "R", objUserInfo.getRoleGrpId());
      strRoleWrite = RoleUtil.getRoleByBoardRead(objBbsInfo.getBbsRole(), "W", objUserInfo.getRoleGrpId());
    }     
    // 내용 삭제시 쓰기권한이 없는 경우 로그인 페이지로 이동시킨다.
    if (strRoleWrite == "") throw new UsernameNotFoundException("내용 삭제시 접근한 게시판에 Read 권한이 존재하지않습니다.");

    // REAL 디렉토리 파일 삭제
    Article article = boardBO.viewArticle(new Integer(atcNo));
    for (ArticleFile articleFile : article.getArticleFileList()) {
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(long 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

            pass = user.getPassword();
            authList.add(new GrantedAuthorityImpl("ROLE_LIBRARIAN"));
            authList.add(new GrantedAuthorityImpl("ROLE_READER"));
        }else{
            Reader reader = readerDAO.findReaderByEmail(email);
            if (reader == null){throw new UsernameNotFoundException("Username Not Found");}
            pass = reader.getPassword();
            authList.add(new GrantedAuthorityImpl("ROLE_READER"));   
        }
         return new User(email, pass, true, true, true, true, authList);
View Full Code Here

      try {
        springSecurityContextSource.afterPropertiesSet();
      } catch (Exception e) {
        log.error("LDAP Context Source not loaded ", e);
        throw new UsernameNotFoundException("LDAP Context Source not loaded", e);
      }

      //TODO change properties
      String userSearchBase = ldapServerProperties.get().getUserSearchBase();
      String userSearchFilter = ldapServerProperties.get().getUserSearchFilter();
View Full Code Here

      try {
        springSecurityContextSource.afterPropertiesSet();
      } catch (Exception e) {
        log.error("LDAP Context Source not loaded ", e);
        throw new UsernameNotFoundException("LDAP Context Source not loaded", e);
      }

      //TODO change properties
      String userSearchBase = ldapServerProperties.get().getUserSearchBase();
      String userSearchFilter = ldapServerProperties.get().getUserSearchFilter();
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(long 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

        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        pageLayout.setCode("person_profile");
        personProfile.setPageLayout(pageLayout);

        expect(userService.getUserByUsername(username)).andThrow(new UsernameNotFoundException("Username does not exist"));

        replay(userService, pageService);

        profileController.viewProfile(username, model, null);
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.