Skip to content

Conversation

@EunJuOh33
Copy link
Owner

@EunJuOh33 EunJuOh33 commented Feb 22, 2021

요약

게시물에 파일을 업로드 할 수 있게 만든다.

관련 이슈

작업 내용

  • pom.xml에 필요한 파일 추가
  • SecurityConfig 파일, SecurityInitialzer 파일 등 추가/WebConfig 클래스 변경 등 환경설정..?
  • 연습용 customLogin 페이지 작성

특이 사항

  • 자바 설정으로만 공부했다..

@EunJuOh33 EunJuOh33 added back-end front-end env 개발 환경 설정과 관련된 이슈 feat 기능 개발과 관련된 이슈 labels Feb 22, 2021
@EunJuOh33 EunJuOh33 self-assigned this Feb 22, 2021
Copy link
Owner Author

@EunJuOh33 EunJuOh33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

에러나서 수정함

Comment on lines 28 to 21
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
.antMatchers("/samplesecurity/all").permitAll()
.antMatchers("/samplesecurity/admin").access("hasRole('ROLE_ADMIN')")
.antMatchers("/samplesecurity/member").access("hasRole('ROLE_MEMBER')");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all 경로는 접근 제한 없음
admin 경로는 'ROLE_ADMIN' 라는 권한이 있는 사용자만 접근 가능
member 경로는 'ROLE_MEMBER'라는 권한이 있는 사용자만 접근 가능

import lombok.extern.log4j.Log4j;

@Controller
@RequestMapping("/samplesecurity/*")
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sample 경로로 연습한 적이 있어서 이번에는 samplesecurity경로를 만들었다..

.antMatchers("/samplesecurity/admin").access("hasRole('ROLE_ADMIN')")
.antMatchers("/samplesecurity/member").access("hasRole('ROLE_MEMBER')");

http.formLogin().loginPage("/customLogin").loginProcessingUrl("/login");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

관리자나 회원이 아닌데 admin, member 페이지로 접근할 경우 customLogin.jsp 페이지로 이동. URI 는 login

.antMatchers("/samplesecurity/member").access("hasRole('ROLE_MEMBER')");

http.formLogin().loginPage("/customLogin").loginProcessingUrl("/login");
http.formLogin().loginPage("/customLogin").loginProcessingUrl("/login").successHandler(loginSuccessHandler());
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back-end env 개발 환경 설정과 관련된 이슈 feat 기능 개발과 관련된 이슈 front-end

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants