我正在尝试使用Facebook OAuth2.0配置Jasig CAS4.0。 没有使用Facebook,默认用户名' casuser'和密码" Mellon"工作正常。 我换了
<bean id="primaryAuthenticationHandler"
class="org.jasig.cas.authentication.AcceptUsersAuthenticationHandler">
<property name="users">
<map>
<entry key="casuser" value="Mellon"/>
</map>
</property>
</bean>
带
<bean id="primaryAuthenticationHandler" class="org.jasig.cas.support.pac4j.authentication.handler.support.ClientAuthenticationHandler">
<constructor-arg index="0" ref="clients"/>
</bean>
和id =&#34; registeredServicesList&#34;是
<util:list id="registeredServicesList">
<bean class="org.jasig.cas.services.RegexRegisteredService"
p:id="0" p:name="HTTP and IMAP"
p:description="Allows HTTP(S) and IMAP(S) protocols"
p:serviceId="^(https?|imaps?)://.*"
p:evaluationOrder="10000001"
p:enabled="true"
p:allowedToProxy="true"
p:ssoEnabled="true"
/>
但是,在从facebook验证到我的CAS服务器然后再到我的应用程序后重定向后,我得到ticketValidationException。
type Exception report
message org.jasig.cas.client.validation.TicketValidationException:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org.jasig.cas.client.validation.TicketValidationException:
The supplied service 'https://rajan.com:2443/CasClientSimple/' is not authorized to use CAS proxy authentication.
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:194)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:116)
我该怎么做才能解决这个问题?
答案 0 :(得分:5)
在CAS服务器的deployerconfigcontext.xml文件中,我添加了一些默认情况下不存在的属性(如allowedToProxy,ssoEnables,enabled),并且工作正常。
<bean class="org.jasig.cas.services.RegisteredServiceImpl">
<property name="id" value="0" />
<property name="name" value="HTTP" />
<property name="description" value="Only Allows HTTP Urls" />
<property name="serviceId" value="https://**" />
<property name="evaluationOrder" value="10000001" />
<property name="enabled" value="true" />
<property name="allowedToProxy" value="true" />
<property name="ssoEnabled" value="true" />
</bean>