[英]Spring Security OAuth2 not using token expire values from properties
[英]spring security oauth2 check_token using Xml
我正在嘗試使用啟用outh / check_token,但根據此答案有一些困難如何使用XML使用Spring Security Oauth2啟用/ oauth / check_token
您需要創建一個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
使用spring oauth2的最新版本:
<dependency>
<groupId>org.springframework.security.oauth</groupId
<artifactId>spring-security-oauth2</artifactId
<version>2.0.10.RELEASE</version>
</dependency>
確保在春季安全性oauth文件配置中使用的是正確版本的xsd:
http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd
將選項check-token-enabled =“ true”插入到元素授權服務器中:
<oauth:authorization-server ... check-token-enabled="true">
...
</oauth:authorization-server>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.