Java/Spring MVC

[20.10.13 SpMVC_Security] 가장 간단한 스프링 시큐리티 기본 패턴

우롱차 2020. 10. 19. 14:44
728x90

 

 

이거를 설정해줌으로해서 spring security에 있는 dependency들이 활동하는것

security에서 설정만 해주는 것 (securiy.xml) 

 

<sec:http>
  <sec:intercept-url pattern="/login" access="permitAll"/>
  <sec:intercept-url pattern="/admin"  access="isAuthenticated()"/>
  <sec:form-login/>
  <sec:logout/>
</sec:http>
      
<sec:authentication-manager>
	<sec:authentication-provider>
        <sec:user-service>
			<sec:user name="admin" password="{noop}1234"  authorities="ROLE_ADMIN"/>
		</sec:user-service>
	</sec:authentication-provider>
</sec:authentication-manager>

완전 간단한패턴! 하나씩 만들어갈거고 기본적으로 패턴이 어떻게 전송되는지 이해만 해주자.

 

>> web.xml

 

728x90