我有一个用svn签出的工作副本; 此外,我在Eclipse中创建了一个新项目,它将工作副本的根目录作为项目的位置.我希望能够像Eclipse中的比较版本那样做.我有Subclipse 1.4.8,但这似乎没有给我我想要的东西.难道我做错了什么?
我正在编写一个需要验证用户电子邮件地址并可能访问他们的 Google 日历的RESTful网络服务(Jersey在 上运行Tomcat)。计划是将用户重定向到通过OAuth2.
我的 Web 服务已受Spring Security. 它适用于基本身份验证(即用户和密码的硬连线列表)。如果我尝试访问任何受保护的资源,系统会提示我登录。
现在我正在尝试连接Spring Security OAuth2. 我的理解是,如果我尝试访问受保护的资源,我将重定向到 Google。
但是,无论我尝试什么,我似乎都无法启动 OAuth。没有记录控制台错误,并且资源受到保护(我收到错误“访问此资源需要完全身份验证”)。
有什么不对;可能是我的配置,我的理解,或两者兼而有之。建议将不胜感激。
web.xml (部分的):
<servlet-mapping>
<servlet-name>Jersey REST Service</servlet-name>
<url-pattern>/V1/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/spring-security.xml</param-value>
</context-param>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Run Code Online (Sandbox Code Playgroud)
spring-security.xml (隐藏谷歌密钥):
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-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/security/oauth2
http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd">
<debug />
<oauth:client id="oauth2ClientFilter" />
<oauth:resource id="googleOauth2Resource"
type="authorization_code"
client-id="hidden"
client-secret="hidden"
access-token-uri="https://accounts.google.com/o/oauth2/v3/token"
user-authorization-uri="https://accounts.google.com/o/oauth2/auth" …Run Code Online (Sandbox Code Playgroud)