@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
authorities.add( () -> ("ROLE_USER"));
return authorities;
}
Iterator<? extends GrantedAuthority> iter = principal.getAuthorities().iterator();
while (iter.hasNext()) {
GrantedAuthority auth = iter.next();
System.out.println(auth.getAuthority());
'Spring Boot' 카테고리의 다른 글
Google JavaScript SDK, Fetherated Identity (0) | 2020.08.01 |
---|---|
oauth2, code, acess token (0) | 2020.08.01 |
Spring Boot - Security (0) | 2020.07.31 |
게시글 보기, 상세글 보기, 수정, 삭제 버튼(권한 있어야함. 없으면 Exception 던짐) (0) | 2020.07.27 |
글쓰기/주소 설계/@Autowired DI하는 방법3가지 (0) | 2020.07.26 |