function oauth2_user_hybridauth_provider_config_alter in OAuth2 Login 8
Same name and namespace in other branches
- 7.2 oauth2_user/profile.inc \oauth2_user_hybridauth_provider_config_alter()
Implements hook_hybridauth_provider_config_alter().
File
- oauth2_user/profile.inc, line 53 
- OAuth2 user profile.
Code
function oauth2_user_hybridauth_provider_config_alter(&$config, $provider_id) {
  if ($provider_id != 'DrupalOAuth2') {
    return;
  }
  // Allow other modules to specify the fields of the user profile.
  // These fields can be defined by the oauth2 server
  // on hook_oauth2_loginprovider_userprofile_alter().
  $profile_fields = array();
  drupal_alter('oauth2_profile_fields', $profile_fields);
  // Add extra profile fields to the config.
  foreach ($profile_fields as $field) {
    $config['profile_fields'][$field] = $field;
  }
}