2012-03-27 4 views
2

私はspring-security-oauth-1.0.0.M3を使用して、spring-security 3.0とoauth2を使用するアプリケーションを開発中です。それはうまく動作します。しかし、Spring Security 3.1への移行は簡単なことではないようです。 oauthモジュールがまだサポートされているという確認を見つけることができませんでした。spring-security-oauth(oauth2の場合)をサポートしていますか?リファレンスはありますか?

例えば、OAuthのチュートリアルでは、3.0ない3.1言及:

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

そして、私は3月4日に同様の問題が発生した、以下の議論では2012年のコメントは、私はストレートのアップグレードを行うにしようとすると、春・セキュリティのOAuth 1.0.0.M3またはM4を使用して3.1に:

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 

誰かが春セキュリティ3.1および春・セキュリティのOAuthを使用するための参照に、上記の問題、またはポイントの解決策を提案する、または他のスプリングセキュリティ3.1を使用してのOAuth2実装するためのより良い代替手段を提案することはできますか?

また、私が春のセキュリティ3.1の基本的な点を見逃している場合は、それも知っておくと便利です。

ありがとうございます!

+1

答えははいです。サポートされています。 Sigh、Spring Securityが判明しました。Spring Security 3.1にはOAuth 1.0.0.M6が必要です(または少なくとも十分です): http://forum.springsource.org/showthread.php?123470-Spring-Security-OAuth-1- 0-0-M6-released 上記のBeanDefinitionParsingExceptionが解決されました。 – Will

+0

これまでのところ、これは最高のリファレンスガイドのようです:https://github.com/SpringSource/spring-security-oauth/wiki/oauth2 – Will

答えて

5

はい、SpringセキュリティOAuthマイルストーンビルド1.0.0.M6、特にoauth2モジュールは、Spring Security 3.1.0をサポートしています。まだリリースとは考えられていません。 OAuth 2.0 spec自体は最終的なものではありません。

1.0.0.M6 samplesは、実装のための最も正確で完全なリファレンスであるようです。完全な1.0.0.M6タグのジップボールはhereです。

OAuth 2 Developers Guideは良いテキスト参照です。少なくとも1.0.0.M6に関しては100%正確ではありません。たとえば、属性user-approval-pageは、authorization-server not authorization-codeに属しています。

Mavenのpom.xmlは、artifactId spring-security-oauth2(1.0.0.M3などの古いバージョンのようにspring-security-oauthではなく)を参照する必要があります。

関連する問題