You are here

function feeds_oauth_authenticate in Feeds OAuth 6

Same name and namespace in other branches
  1. 7 feeds_oauth.module \feeds_oauth_authenticate()
1 string reference to 'feeds_oauth_authenticate'
feeds_oauth_menu in ./feeds_oauth.module
Implementation of hook_menu().

File

./feeds_oauth.module, line 64

Code

function feeds_oauth_authenticate($id) {
  $fetcher = feeds_importer($id)->fetcher;
  $config = $fetcher
    ->getConfig();
  $oauth = new OAuth($config['consumer_key'], $config['consumer_secret'], OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
  $_SESSION['feeds']['request_token_info'] = $oauth
    ->getRequestToken($config['request_token_url']);
  $_SESSION['feeds']['id'] = $id;
  drupal_goto(url($config['authorize_url'], array(
    'absolute' => TRUE,
    'query' => array(
      'oauth_token' => $_SESSION['feeds']['request_token_info']['oauth_token'],
    ),
  )));
}