function JanrainCaptureApi::refreshAccessToken in Janrain Registration 7.3
Same name and namespace in other branches
- 6 janrain_capture.api.inc \JanrainCaptureApi::refreshAccessToken()
- 7.4 includes/janrain_capture.api.inc \JanrainCaptureApi::refreshAccessToken()
- 7 janrain_capture.api.inc \JanrainCaptureApi::refreshAccessToken()
- 7.2 includes/janrain_capture.api.inc \JanrainCaptureApi::refreshAccessToken()
Retrieves a new access_token/refresh_token set
Return value
boolean Boolean success or failure
1 call to JanrainCaptureApi::refreshAccessToken()
- JanrainCaptureApi::loadUserEntity in includes/
janrain_capture.api.inc - Retrives the user entity from Capture
File
- includes/
janrain_capture.api.inc, line 199 - An API Client for making calls to the Janrain Capture web service.
Class
- JanrainCaptureApi
- @file An API Client for making calls to the Janrain Capture web service.
Code
function refreshAccessToken() {
if (empty($_SESSION['janrain_capture_refresh_token'])) {
return FALSE;
}
$refresh_token = $this
->refreshTokenReveal($_SESSION['janrain_capture_refresh_token']);
$command = "oauth/token";
$arg_array = array(
'refresh_token' => $refresh_token,
'grant_type' => 'refresh_token',
);
$json_data = $this
->call($command, $arg_array);
if ($json_data) {
$this
->updateCaptureSession($json_data);
return TRUE;
}
return FALSE;
}