function openid_connect_log_request_error in OpenID Connect / OAuth client 7
Logs an error occured during a request towards a login provider.
2 calls to openid_connect_log_request_error()
- OpenIDConnectClientBase::retrieveTokens in includes/
OpenIDConnectClientBase.class.php - Retrieve access token and ID token.
- OpenIDConnectClientBase::retrieveUserInfo in includes/
OpenIDConnectClientBase.class.php - Retrieves user info: additional user profile data.
File
- ./
openid_connect.module, line 643 - A pluggable client implementation for the OpenID Connect protocol.
Code
function openid_connect_log_request_error($method, $client_name, $response) {
switch ($method) {
case 'retrieveTokens':
$message = 'Could not retrieve tokens (@code @error). Details: @details';
break;
case 'retrieveUserInfo':
$message = 'Could not retrieve user profile information (@code @error). Details: @details';
break;
default:
return;
}
// Some error responses don't have a data key set.
$details = '';
if (!empty($response->data)) {
$details = print_r(drupal_json_decode($response->data), TRUE);
}
$variables = array(
'@error' => $response->error,
'@code' => $response->code,
'@details' => $details,
);
watchdog('openid_connect_' . $client_name, $message, $variables, WATCHDOG_ERROR);
}