Próbuję mieć kontekst ochrony wiosennej w kontekście podrzędnym, więc mógłbym mieć zabezpieczenia URL w pliku kontekstowym serwletu.Jak mieć kontekst ochrony w kontekście dziecięcym
mam:
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/spring-security.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>myapp-soap</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<init-param>
<param-name>transformWsdlLocations</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
na web.xml, ogólną konfigurację zabezpieczeń sprężynowy security.xml i
<!-- Authorization configurations -->
<security:http auto-config="false" use-expressions="true"
create-session="never"
authentication-manager-ref="authenticationManager"
entry-point-ref="authenticationEntryPoint">
<security:custom-filter
position="PRE_AUTH_FILTER" ref="serviceAuthenticationFilter"/>
<security:intercept-url
pattern="/GetForbiddenUrl" access="hasRole('roleThatDoesntExist')" />
<security:intercept-url pattern="/**" access="permitAll" />
</security:http>
<!-- annotation security -->
<security:global-method-security pre-post-annotations="enabled"/>
na myapp-mydła servlet.xml. To nie działa, ale nie działa z
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/my-app/v1/soap]] (ServerService Thread Pool -- 192) JBWEB000284: Exception starting filter springSecurityFilterChain:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
Jednakże, jeśli przeniosę <security:http>
część do konfiguracji kontekstowego korzeni wiosna-security, wszystko działa. Czy nie powinno to działać tak, jak próbuję? Jak mogę uzyskać zabezpieczenia oparte na url w kontekście mojego dziecka?
Próbowałem również połączyć pliki kontekstowe w jeden, ale ten sam problem wydaje się występować.
jesteś pewien, że twój wiosna-security.xml jest odbierany przez wiosnę? –
@MaksymDemidas tak, ponieważ przeniesienie części 'http' powoduje zastosowanie wszystkich dyrektyw, zarówno w kontekście parnt, jak i podrzędnym – eis