【发布时间】:2016-02-23 08:13:42
【问题描述】:
我正在尝试使用 outh/check_token 启用,但遇到了一些困难 根据这个答案How to enable /oauth/check_token with Spring Security Oauth2 using XML
您需要创建一个 CheckTokenEndpoint 类型的 bean。 我们如何做到这一点,我将它包含在我的 spring security.xml 中
<bean id="checkTokenEndpoint" class="org.springframework.security.oauth2.provider.endpoint.CheckTokenEndpoint">
<constructor-arg name="resourceServerTokenServices" ref="tokenServices"/>
</bean>
这个类 org.springframework.security.oauth2.provider.endpoint.CheckTokenEndpoint 正在抛出错误
Multiple annotations found at this line:
- Class 'org.springframework.security.oauth2.provider.endpoint.CheckTokenEndpoint' not found
- Class 'org.springframework.security.oauth2.provider.endpoint.CheckTokenEndpoint' not found [config set: AuthenticationApp/web-
context]
这就是全部
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sec="http://www.springframework.org/schema/security" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd ">
有人可以帮助所有示例都使用 spring boot 和 java config,但我必须使用 xml config
【问题讨论】:
标签: java spring spring-mvc spring-security spring-security-oauth2