Lines Matching refs:token
33 public $token; variable in Google_OAuth2
107 $this->token['created'] = time();
156 * @param string $token
159 public function setAccessToken($token) { argument
160 $token = json_decode($token, true);
161 if ($token == null) {
164 if (! isset($token['access_token'])) {
167 $this->token = $token;
171 return json_encode($this->token);
210 if (null == $this->token && null == $this->assertionCredentials) {
220 if (! array_key_exists('refresh_token', $this->token)) {
225 $this->refreshToken($this->token['refresh_token']);
231 array('Authorization' => 'Bearer ' . $this->token['access_token'])
275 $token = json_decode($body, true);
276 if ($token == null) {
280 if (! isset($token['access_token']) || ! isset($token['expires_in'])) {
284 $this->token['access_token'] = $token['access_token'];
285 $this->token['expires_in'] = $token['expires_in'];
286 $this->token['created'] = time();
296 * @param string|null $token The token (access token or a refresh token) that should be revoked.
299 public function revokeToken($token = null) { argument
300 if (!$token) {
301 $token = $this->token['access_token'];
303 $request = new Google_HttpRequest(self::OAUTH2_REVOKE_URI, 'POST', array(), "token=$token");
307 $this->token = null;
319 if (null == $this->token) {
324 $expired = ($this->token['created']
325 + ($this->token['expires_in'] - 30)) < time();
361 $id_token = $this->token['id_token'];