I’m trying to setup our REST server for OAuth2 with spring-security. (The server already supports spring-security without OAuth). Now I tried to follow the sparklr example and added the spring-security-oauth artifact to my maven (mvn dependency:tree shows it is available) as well as the namespace configuration to my spring-security-context.xml but all I get is:
Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security/oauth2]
Browsing to http://www.springframework.org/schema/security/ all I see are the .xsd files but no oauth2 folder.. How can that be? I am assuming the sparklr example is a working version, so what am I doing wrong?
Here’s my spring-security-context header:
<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:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
If needed, here’s the maven setup:
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth</artifactId>
<version>1.0.0.RC2</version>
</dependency>
You referer to OAuth2 but import the OAuth 1. replace the dependency to