joscha / play-authenticate

An authentication plugin for Play Framework 2.x (Java)
http://joscha.github.com/play-authenticate/
Other
807 stars 366 forks source link

Implements refresh token behaviour #244

Open mcarrolle opened 9 years ago

mcarrolle commented 9 years ago

This improvements relates to this issue #57

I create a method refresh which contains the logic to perform a refresh token action. I implement only for GoogleAuthProvider. I modify PlayAuthenticate.isLoggedIn method to launch the refresh token action when the current token is expired.

joscha commented 9 years ago

@mcarrolle nice, however storing and reading from the cache is not the best idea unfortunately, it already causes a lot of problems in the connection/link process and that is only a few minutes. Can we think of a different way of storing it?

mcarrolle commented 9 years ago

Yes you are right. Refresh token need to be stored in reliable storage like database. I am going to add two method (getRefreshToken and saveRefreshToken) in the UserService interface. Is it OK for you ?