Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
security의 annotation 설정 관련 문의드립니다.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
파란하늘  
View profile   Translate to Translated (View Original)
 More options Dec 6 2010, 11:48 am
From: 파란하늘 <luver...@hanmail.net>
Date: Mon, 6 Dec 2010 08:48:04 -0800 (PST)
Local: Mon, Dec 6 2010 11:48 am
Subject: security의 annotation 설정 관련 문의드립니다.
안녕하세요.

@mvc에 security annotation을 적용하면서 생긴 문제에 대해 문의드립니다.

상위 root applicationContext엔 *Service, *Dao 를, 하위 servletContext엔
*Controller를 설정하였습니다.
그리고 상위 Context에 Security관련 xml설정을 하였습니다.

이렇게 하는 경우 *Service 에서는 security annotation이 잘 동작하지만
Controller에서는 인식을 하지 않습니다.

proxy 적용시점이 각 Context마다 개별로 동작하게 되는 듯한데요.
이런 경우 올바른 설정은 어떻게 해야하는지요?

security관련 설정을 servlet쪽으로 내리면 filter생성시 빈객체를 찾지 못하게됩니다.
결국 security는 rootContext에 붙여야 할 것 같은데 사용은 하위 Controller에서 할 수 있는 방법이 궁금
합니다.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
박용권  
View profile   Translate to Translated (View Original)
 More options Dec 6 2010, 8:06 pm
From: 박용권 <arawn...@gmail.com>
Date: Tue, 7 Dec 2010 10:06:17 +0900
Local: Mon, Dec 6 2010 8:06 pm
Subject: Re: security의 annotation 설정 관련 문의드립니다.

Controller 의 시큐리티는 애노테이션을 쓰는 경우보다는 다음과 같이 설정하는게 일반적이지 않을까요.

<http auto-config='true'>
    <intercept-url pattern="/login.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
    <intercept-url pattern="/**" access="ROLE_USER" />
    <form-login login-page='/login.jsp'/></http>

2010년 12월 7일 오전 1:48, 파란하늘 <luver...@hanmail.net>님의 말:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sungchul Park  
View profile   Translate to Translated (View Original)
 More options Dec 6 2010, 9:18 pm
From: Sungchul Park <gyu...@gmail.com>
Date: Tue, 07 Dec 2010 11:18:58 +0900
Local: Mon, Dec 6 2010 9:18 pm
Subject: Re: security의 annotation 설정 관련 문의드립니다.

> 이렇게 하는 경우 *Service 에서는 security annotation이 잘 동작하지만
> Controller에서는 인식을 하지 않습니다.

> proxy 적용시점이 각 Context마다 개별로 동작하게 되는 듯한데요.
> 이런 경우 올바른 설정은 어떻게 해야하는지요?

예 맞습니다. 스프링 시큐리티의 메서드 보안 기능은 AOP를 사용하기 때문에
AOP의 특성이 그대로 따라옵니다. 즉, AOP 처리 범위가 해당 application
context로 제한됩니다.

> security관련 설정을 servlet쪽으로 내리면 filter생성시 빈객체를 찾지 못하게됩니다.
> 결국 security는 rootContext에 붙여야 할 것 같은데 사용은 하위 Controller에서 할 수 있는 방법이 궁금 합니다.

필터에서 찾는 Web Application Context는 Root application context인데 스
프링 보안이 설정된 application context는 Dispatcher Servlet에서 설정한
하부 application context이기 때문에 빈을 못 찾고 있습니다.

기존 처럼 root application context에 스프링 보안을 설정하시고 메서드 보
안을 적용하고 싶은 하부 application context에서 <global-method-security>
네임스페이스만 추가로 사용해보십시오. 잘 작동할 겁니다.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
파란하늘  
View profile   Translate to Translated (View Original)
 More options Dec 7 2010, 12:16 am
From: 파란하늘 <luver...@hanmail.net>
Date: Mon, 6 Dec 2010 21:16:14 -0800 (PST)
Local: Tues, Dec 7 2010 12:16 am
Subject: Re: security의 annotation 설정 관련 문의드립니다.
답글 감사드립니다.

박용권님의 말처럼 url path 단위로도 구성을 하는 방법도 있는데요.
board의 경우 list나 view와 write에 대한 권한을 따로 주어 특정 method단위로 권한을 부여하고 싶었습니다.

박성철 님이 알려주신 것처럼
Controller에 대한 mvc설정을 한 하위 Context에서
</sec:global-method-security> 설정을 해보니
아쉽게도 security aop는 정상 적용되지만 mvc annotation은 적용되지 않는 문제가 있었습니다.

JDK proxy의 문제인 듯하여 CGLIB proxy에 대한 설정 옵션을 활성화하니 제대로 동작하였습니다.
<sec:http auto-config="true" use-expressions="true">

많은 도움 주셔서 감사합니다. (__)

On 12월7일, 오전11시18분, Sungchul Park <gyu...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
파란하늘  
View profile   Translate to Translated (View Original)
 More options Dec 7 2010, 12:17 am
From: 파란하늘 <luver...@hanmail.net>
Date: Mon, 6 Dec 2010 21:17:52 -0800 (PST)
Local: Tues, Dec 7 2010 12:17 am
Subject: Re: security의 annotation 설정 관련 문의드립니다.
옵션을 잘못 메일 드렸네요;;
<sec:global-method-security proxy-target-class="true" secured-
annotations="enabled" jsr250-annotations="enabled" pre-post-
annotations="enabled">

proxy-target-class="true"

위 옵션을 추가하였습니다.;;

On 12월7일, 오후2시16분, 파란하늘 <luver...@hanmail.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »