사용자 도구

사이트 도구


springframework:security

문서의 이전 판입니다!


Spring Security

http

  • <intercept-url pattern=“/someurl/*” filters=“none” /> 에서 filters=“none”이면 해당 URL에서는 Spring Security 관련 기능이 아무것도 작동하지 않게 된다.

Expression Handler

global-method-security에 핸들러 지정

<global-method-security>
  <expression-handler ref="myMethodSecurityExpressionHandler"/>
</global-method-security>

http에 핸들러 지정

  • SpringSecurity 3.0 에서는 XML 태그를 통해 웹 전반에 관한 expressionHandler 설정이 불가능 하다. SEC-1452 버그 참조. 3.1부터 가능.
  • access-decision-manager-ref를 지정함으로써만 가능하다. 다음 참조.
<!-- This must go before the http element in order to be used by security:authorize tags using the access attribute -->
<bean id="expressionHandler" class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler">
  <property name="roleHierarchy" ref="roleHierarchy" /> <!-- 꼭 필요한지는 의문 -->
</bean>
 
<security:http auto-config="true" use-expressions="true" access-decision-manager-ref="accessDecisionManager">
  ...
</security:http>
 
<!-- security:authorize tags using the url attribute will delegate to this accessDecisionManager -->
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
  <property name="decisionVoters">
    <list>
      <ref bean="webExpressionVoter" />
    </list>
  </property>
</bean>
 
<bean id="webExpressionVoter" class="org.springframework.security.web.access.expression.WebExpressionVoter">
  <property name="expressionHandler" ref="expressionHandler" />
</bean>
 
<!-- 꼭 필요한지는 의문 -->
<bean id="roleHierarchy" class="org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl">
  <property name="hierarchy">
    <value>
      ROLE_A > ROLE_B
      ROLE_B > ROLE_AUTHENTICATED
      ROLE_AUTHENTICATED >
      ROLE_UNAUTHENTICATED
    </value>
  </property>
</bean>

Access Denied Handler

springframework/security.1345615991.txt.gz · 마지막으로 수정됨: 2012/08/22 15:13 저자 kwon37xi