[opw-web] Request offline access to the Google API's



commit 4007fb27a03f6e4c54200e007bd8a5423cb78550
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Mar 10 20:07:33 2014 -0400

    Request offline access to the Google API's
    
    Request offline accesss (with a refresh token) to the Google API's.
    This avoids problems if we get in a state where HybridAuth knows
    about our connection to Google but it is expired - HybridAuth assumes
    it can refresh with a refresh token.
    
    Since we don't request any write access or highly sensitive information
    from the Google account, the risk of having the refresh tokens around
    should be low - and they do get GC'ed with PHP session information
    pretty quickly.

 classes/class_user.php |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/classes/class_user.php b/classes/class_user.php
index 09f904a..8e4056d 100644
--- a/classes/class_user.php
+++ b/classes/class_user.php
@@ -48,7 +48,10 @@ class user
                          ),
                          "scope" => "https://www.googleapis.com/auth/userinfo.profile ".
                                     "https://www.googleapis.com/auth/userinfo.email"; ,
-                         "access_type" => "online"
+                          // We need to have offline access because HybridAuth's google provider doesn't
+                          // deal well with the case where it has an expired acess token and no refresh
+                          // token. (A refresh token is only given to offline clients.)
+                         "access_type" => "offline"
                      ),
                      "Facebook" => array (
                          "enabled" => true,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]