【问题标题】:allow specific role in cas允许在 cas 中扮演特定角色
【发布时间】:2015-07-17 22:25:38
【问题描述】:

我有一个 cas 服务器,它可以正确地验证并发送回一些属性。现在我想添加一个服务来检查主体属性中的用户角色,并仅在登录用户具有特定角色(如管理员角色!)时才允许访问服务。

我阅读了“requiredHandlers”并认为它可以提供帮助,但我无法让它发挥作用!

对于服务,我有这样的东西:

    <bean class="org.jasig.cas.services.RegexRegisteredService">
        <property name="id" value="1"/>
        <property name="name" value="Admin panel service"/>
        <property name="serviceId" value="http://localhost:8080/admin"/>
        <property name="evaluationOrder" value="0"/>
        <property name="ignoreAttributes" value="true"/>
        <property name="requiredHandlers" value="supporterAuthenticationHandler"> <!-- this is what i found so far -->
        </property>
    </bean>

supporterAuthenticationHandlerauthenticationManager 中定义

<bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">
    <constructor-arg>
        <map>
            <entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver"/>
            <entry key-ref="primaryAuthenticationHandler"><null /></entry>
            <entry key-ref="supporterAuthenticationHandler"><null /></entry>
        </map>
    </constructor-arg>

    <property name="authenticationPolicy">
        <bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy"/>
    </property>
</bean>

supporterAuthenticationHandler 是 AuthenticationHandler 的一个简单实现(还没有实现。

问题是我不能让 cas 检查supporterAuthenticationHandler,这样我就可以走得更远(并且可能掉进另一个洞,我需要带有属性的新校长)。

我是不是完全走错了路?我应该在我的管理应用程序中检查用户角色吗?甚至可以使用具有不同服务的 cas 检查角色吗?

【问题讨论】:

    标签: authentication cas


    【解决方案1】:

    这说明 CAS 是身份验证服务而不是授权服务。 CAS 仅确保用户是他们所说的人,而不是他们在应用程序(服务)中可以做的事情。

    请看这个答案

    https://security.stackexchange.com/questions/7623/can-central-authentication-service-cas-do-authorization

    【讨论】:

    • 我不想使用 cas 作为授权。出色地。这有点授权,但我想为整个服务做它,而不仅仅是它的一部分。我已经在某处读过它,但无法再次找到它。 CAS 必须能够以某种方式授权对特殊服务的访问。 (现在我在服务中检查服务授权)
    • 根据您的问题,它是授权。身份验证仅确认用户是谁,而不是他们在您的安全系统中的角色。您必须在 cas 中构建一个完整的授权系统才能执行您想要的操作。既然已经有系统可以进行授权和身份验证,为什么还要麻烦呢。
    猜你喜欢
    • 2020-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-17
    • 2020-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多