1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 23:41:29 +02:00

[feature/oauth] Create OAuth service classes

PHPBB3-11673
This commit is contained in:
Joseph Warner
2013-07-14 15:16:34 -04:00
parent 00d0e10200
commit 947aa2b6b4
16 changed files with 442 additions and 31 deletions

View File

@@ -0,0 +1,32 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Bitly OAuth service
*
* @package auth
*/
abstract class phpbb_auth_provider_oauth_service_base implements phpbb_auth_provider_oauth_service_interface
{
/**
* {@inheritdoc}
*/
public function get_auth_scope()
{
return array();
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Bitly OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Box OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_box extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Facebook OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* FitBit OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_box extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* FourSquare OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_foursquare extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,34 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* GitHub OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_github extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_auth_scope()
{
return array(
'user',
);
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Google OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_auth_scope()
{
return array(
'userinfo_email',
'userinfo_profile',
);
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* instragram OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_instagram extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_auth_scope()
{
return array(
'basic',
);
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* OAuth service interface
*
* @package auth
*/
interface phpbb_auth_provider_oauth_service_interface
{
/**
* Returns an array of the scopes necessary for auth
*
* @return array An array of the required scopes
*/
public function get_auth_scope();
}

View File

@@ -0,0 +1,34 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* LinkedIn OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_linkedin extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_auth_scope()
{
return array(
'r_basicprofile',
);
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Microsoft OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_microsoft extends phpbb_auth_provider_oauth_service_base
{
/**
* {@inheritdoc}
*/
public function get_auth_scope()
{
return array(
'basic',
);
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* SoundCloud OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_soundcloud extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Tumblr OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_tumblr extends phpbb_auth_provider_oauth_service_base
{
}

View File

@@ -0,0 +1,26 @@
<?php
/**
*
* @package auth
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Twitter OAuth service
*
* @package auth
*/
class phpbb_auth_provider_oauth_service_twitter extends phpbb_auth_provider_oauth_service_base
{
}