[英]Store access token on my Grails OAuth provider using Spring Security 3
I've just implemented a oAuth provider for my Grails application, and can sucessfully authenticate my client application (using signpost). 我刚刚为我的Grails应用程序实现了oAuth提供程序,并且可以成功验证我的客户端应用程序(使用路标)。 The next thing I want to do is persist the access token, so my client doesn't have to accept permission everytime.
我要做的下一件事是保持访问令牌,所以我的客户端不必每次都接受权限。 On the server I use the Spring Security OAuth package.
在服务器上,我使用Spring Security OAuth包。
I guess I have to implement my own OAuthProviderTokenServices but I'm not sure. 我想我必须实现自己的OAuthProviderTokenServices,但我不确定。 Is there any out-of-the-box handler that I can use, or what is the way to go?
我可以使用任何开箱即用的处理程序,或者是什么方式去?
Thanx!! 感谢名单!
There is an out of the box provider for OAuth2 (JdbcOAuth2ProviderTokenServices) but it looks like there is not a comparable class for OAuth 1. Your best bet would be to subclass RandomValueProviderTokenServices and implement the three abstract persistence related methods. OAuth2(JdbcOAuth2ProviderTokenServices)有一个开箱即用的提供程序,但看起来OAuth 1没有类似的类。您最好的选择是子类RandomValueProviderTokenServices并实现三个抽象持久性相关方法。 Take a look at JdbcOAuth2ProviderTokenServices for code to borrow, especially around serializing the Authentication object.
查看JdbcOAuth2ProviderTokenServices以获取要借用的代码,尤其是在序列化Authentication对象时。
I implemented a custom JPA backed OAuth2ProviderTokenServices in a similar way and it was pretty easy. 我以类似的方式实现了一个自定义JPA支持的OAuth2ProviderTokenServices,它非常简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.