开发者

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). 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.

I guess I have to implement my own OAuthProviderTokenServices but I'm not sure. 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. Take a look at JdbcOAuth2ProviderTokenServices for code to borrow, especially around serializing the Authentication object.

I implemented a custom JPA backed OAuth2ProviderTokenServices in a similar way and it was pretty easy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜