我使用OAuth协议支持部署了我的CAS服务器
我已将此代码添加到我的deployerConfigContext.xml
<bean class="org.jasig.cas.services.RegisteredServiceImpl">
<property name="id" value="1"/>
<property name="name" value="the_key"/>
<property name="description" value="the_secret"/>
<property name="theme" value="my great webapp for OAuth"/>
<property name="serviceId" value="http://localhost:8080/cas/login"/>
<property name="evaluationOrder" value="10000001"/>
<property name="allowedAttributes">
<list>
<!-- facebook -->
<value>the_key</value>
<value>the_secret</value>
</list>
</property>
</bean>
和
<bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry">
<constructor-arg index="0" value="1000"/>
<constructor-arg index="1" value="1"/>
<constructor-arg index="2" value="16"/>
</bean>
定义我的ticketRegistry 所以我的OAuth客户端密码密钥是the_secret和the_key
但是当我加载此网址http://localhost:8080/cas/oauth2.0/accessToken?client_secret=the_secret&grant_type=refresh_token&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fcas%2Flogin&code=0&client_id=the_key
来测试我的OAuth协议时,我发现了此异常
<Code Expired 0>
为什么以及如何解决?
答案 0 :(得分:1)
您需要定义两个CAS服务:
http://localhost:8080/cas/oauth2.0/callbackAuthorize
)文档:https://wiki.jasig.org/display/CASUM/OAuth+server+support,第3部分......