[feature/oauth] Get service credentials on each OAuth service

PHPBB3-11673
This commit is contained in:
Joseph Warner 2013-07-14 16:00:41 -04:00
parent 55cdc874e6
commit 6a2871692c
19 changed files with 201 additions and 12 deletions

View file

@ -31,4 +31,15 @@ class phpbb_auth_provider_oauth_service_amazon extends phpbb_auth_provider_oauth
'profile',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_amazon_key'],
'secret' => $this->config['auth_oauth_amazon_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_bitly_key'],
'secret' => $this->config['auth_oauth_bitly_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_box extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_box_key'],
'secret' => $this->config['auth_oauth_box_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_dropbox extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_dropbox_key'],
'secret' => $this->config['auth_oauth_dropbox_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_facebook_key'],
'secret' => $this->config['auth_oauth_facebook_secret'],
);
}
}

View file

@ -20,7 +20,16 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_box extends phpbb_auth_provider_oauth_service_base
class phpbb_auth_provider_oauth_service_fitbit extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_fitbit_key'],
'secret' => $this->config['auth_oauth_fitbit_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_foursquare extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_foursquare_key'],
'secret' => $this->config['auth_oauth_foursquare_secret'],
);
}
}

View file

@ -31,4 +31,15 @@ class phpbb_auth_provider_oauth_service_github extends phpbb_auth_provider_oauth
'user',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_github_key'],
'secret' => $this->config['auth_oauth_github_secret'],
);
}
}

View file

@ -32,4 +32,15 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth
'userinfo_profile',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_google_key'],
'secret' => $this->config['auth_oauth_google_secret'],
);
}
}

View file

@ -31,4 +31,15 @@ class phpbb_auth_provider_oauth_service_instagram extends phpbb_auth_provider_oa
'basic',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_instagram_key'],
'secret' => $this->config['auth_oauth_instagram_secret'],
);
}
}

View file

@ -28,4 +28,17 @@ interface phpbb_auth_provider_oauth_service_interface
* @return array An array of the required scopes
*/
public function get_auth_scope();
/**
* Returns an array containing the service credentials belonging to requested
* service.
*
* @return array An array containing the 'key' and the 'secret' of the
* service in the form:
* array(
* 'key' => string
* 'secret' => string
* )
*/
public function get_service_credentials();
}

View file

@ -31,4 +31,15 @@ class phpbb_auth_provider_oauth_service_linkedin extends phpbb_auth_provider_oau
'r_basicprofile',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_linkedin_key'],
'secret' => $this->config['auth_oauth_linkedin_secret'],
);
}
}

View file

@ -31,4 +31,15 @@ class phpbb_auth_provider_oauth_service_microsoft extends phpbb_auth_provider_oa
'basic',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_microsoft_key'],
'secret' => $this->config['auth_oauth_microsoft_secret'],
);
}
}

View file

@ -33,4 +33,15 @@ class phpbb_auth_provider_oauth_service_paypal extends phpbb_auth_provider_oauth
'email',
);
}
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_paypal_key'],
'secret' => $this->config['auth_oauth_paypal_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_soundcloud extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_soundcloud_key'],
'secret' => $this->config['auth_oauth_soundcloud_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_tumblr extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_tumblr_key'],
'secret' => $this->config['auth_oauth_tumblr_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_twitter extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_twitter_key'],
'secret' => $this->config['auth_oauth_twitter_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_vkontakte extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_vkontakte_key'],
'secret' => $this->config['auth_oauth_vkontakte_secret'],
);
}
}

View file

@ -22,5 +22,14 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_auth_provider_oauth_service_yammer extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_service_credentials()
{
return array(
'key' => $this->config['auth_oauth_yammer_key'],
'secret' => $this->config['auth_oauth_yammer_secret'],
);
}
}