我正在尝试实施OAuth2服务器,该服务器将对客户端进行身份验证并通过令牌对其进行授权。 但是在使用这个模式时我遇到了编译错误。
问题:显示错误
“cvc-complex-type.2.4.c:匹配的通配符是严格的,但是找不到元素'oauth:client'的声明”
Plz帮助。
我正在关注 https://www.javacodegeeks.com/2012/02/oauth-with-spring-security.html
` http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2.xsd“>
<!-- Root Context: defines shared resources visible to all other web components -->
<http auto-config='true'>
<intercept-url pattern="/**" access="ROLE_USER" />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="jimi" password="jimi" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
<!--apply the oauth client context -->
<oauth:client token-services-ref="oauth2TokenServices" />
<beans:bean id="oauth2TokenServices"
class="org.springframework.security.oauth2.consumer.token.InMemoryOAuth2ClientTokenServices" />
<oauth:resource id="cv" type="authorization_code"
clientId="foo" accessTokenUri="http://localhost:8080/cv/oauth/authorize"
userAuthorizationUri="http://localhost:8080/cv/oauth/user/authorize" />
<beans:bean id="cvService" class="org.springsource.oauth.CVServiceImpl">
<beans:property name="cvURL" value="http://localhost:8080/cv/cvs"></beans:property>
<beans:property name="cvRestTemplate">
<beans:bean class="org.springframework.security.oauth2.consumer.OAuth2RestTemplate">
<beans:constructor-arg ref="cv"/>
</beans:bean>
</beans:property>
<beans:property name="tokenServices" ref="oauth2TokenServices"></beans:property>
</beans:bean>
`