4

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!!

Michael Bavin
  • 3,944
  • 6
  • 31
  • 35

1 Answers1

1

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.

sourcedelica
  • 23,940
  • 7
  • 66
  • 74
  • Ok, I started the implementation and it works. Only deserialising was a problem because the classloader couldn't find groovy class GrailsUser. Make a method so you can pass the groovy classloader. – Michael Bavin Mar 08 '11 at 09:08
  • It would be greatly appreciated if you could share the code you used to solve this problem. ;-) – Javid Jamae Jul 02 '11 at 05:19