Как ссылаться на атрибут bean-компонента внутри тега intercept-url для безопасности Spring? - PullRequest
0 голосов
/ 15 февраля 2019

В настоящее время я пытаюсь сослаться на пружинный компонент, который я создал внутри XML-файла для моего приложения Spring-Security, внутри тега для контроля доступа.Вот мой код.

<bean id="devbox-freeipa-zone" class="com.stratahealth.pathways.connect.logon.beans.TargetedAuthorizationZone">
    <property name="name" value="${logon.freeipa.zone.name}" />
    <property name="target" ref="devbox-gateway-target" />

    <property name="roles" value="role1,role2" />

</bean>


<!-- Security Manager -->
<security:http pattern="/${logon.freeipa.zone.name}.zone/**"
               use-expressions="true"
               access-decision-manager-ref="devbox-freeipa-decision-manager"
               auto-config="true" authentication-manager-ref="devbox-freeipa-zone-authenticationManager">

    <!--
        Use the following to determine which roles are required for the specified LDAP zone. Configure the following property
        ${logon.ZONENAME.roles.list} either as a singular role or comma separated values.
    -->
    <security:intercept-url pattern="/**" access="isAuthenticated() and @zoneAuthenticationService.authenticationhasRoles(authentication, devbox-freeipa-zone.roles)" />

    <security:form-login login-page="/Interactive/UsernamePasswordAuth.xhtml?zone=${logon.freeipa.zone.name}"
                         login-processing-url="/${logon.freeipa.zone.name}.zone/j_spring_security_check"
                         authentication-failure-url="/Interactive/LdapFailure.xhtml"
                         default-target-url="/${logon.freeipa.zone.name}.zone/api/app/postLogin" />
    <security:http-basic />
    <security:access-denied-handler ref="devbox-freeipa-access-denied-handler"/>

</security:http>

То, что я пытаюсь заставить работать, - это ссылка на bean-компонент devbox-freeipa-zone.roles внутри тега intercept-url моей весенней конфигурации безопасности.Но каждый раз, когда я пытаюсь, мое приложение не выдает никаких исключений / ошибок.Я только что получил 404.

Может кто-нибудь помочь мне с этим?

...