【问题标题】:Does spring-security 3.1 support spring-security-oauth (for oauth2)? Is there a reference?spring-security 3.1 是否支持 spring-security-oauth(对于 oauth2)?有参考吗?
【发布时间】:2012-04-11 10:32:27
【问题描述】:

我正在使用 spring-security-oauth-1.0.0.M3 使用 spring-security 3.0 和 oauth2 的应用程序。它工作正常。但看起来迁移到 spring-security 3.1 并非易事。我一直无法确认是否仍然支持 oauth 模块。

例如,oauth 教程提到 3.0 而不是 3.1:

https://github.com/SpringSource/spring-security-oauth/wiki/tutorial

当我尝试使用 spring-security-oauth 1.0.0.M3 或 M4 直接升级到 3.1 时,我在以下讨论中遇到了类似于 2012 年 3 月 4 日评论的问题:

http://code.google.com/p/spring-security-social/wiki/Usage

具体来说,我在 Tomcat 日志中看到了这一点:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration
problem: Failed to import bean definitions from URL location ...
Offending resource: class path resource [spring/applicationContext.xml]; nested
exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from URL ...; nested exception is
org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class
[org.springframework.security.oauth2.config.OAuth2SecurityNamespaceHandler] for namespace
[http://www.springframework.org/schema/security/oauth2]: problem with handler class file or
dependent class; nested exception is java.lang.NoClassDefFoundError:
org/springframework/security/web/util/AntUrlPathMatcher

有人可以提出上述问题的解决方案,或者指出使用 spring-security 3.1 和 spring-security-oauth 的参考,或者建议使用 spring-security 3.1 实现 oauth2 的更好替代方案?

或者,如果我错过了 spring-security 3.1 的一个基本点,那么了解这也很有用。

谢谢!

【问题讨论】:

标签: spring-security oauth-2.0


【解决方案1】:

是的,Spring Security OAuth 里程碑版本 1.0.0.M6,特别是 oauth2 模块,支持 Spring Security 3.1.0。它尚未被视为发布。 OAuth 2.0 spec 本身不是最终的。

1.0.0.M6 samples 似乎是最准确和最完整的实施参考。完整的 1.0.0.M6 标签 zipball 是here

OAuth 2 Developers Guide 是一个很好的文本参考。它不是 100% 准确的,至少就 1.0.0.M6 而言。比如属性user-approval-page属于authorization-server而不是authorization-code。

Maven pom.xml 必须引用 artifactId spring-security-oauth2(而不是像 1.0.0.M3 这样的旧版本中的 spring-security-oauth)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-16
    • 2020-05-26
    • 2018-10-07
    • 2019-09-25
    • 2010-12-09
    • 2017-09-11
    • 1970-01-01
    相关资源
    最近更新 更多