Enabled OAuth/OAuth2 logins
This commit is contained in:
32
modules/oauth/classes/Kohana/OAuth2/Provider/Facebook.php
Normal file
32
modules/oauth/classes/Kohana/OAuth2/Provider/Facebook.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
/**
|
||||
* OAuth Facebook Provider
|
||||
*
|
||||
* @package Kohana/OAuth2
|
||||
* @category Provider
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
abstract class Kohana_OAuth2_Provider_Facebook extends OAuth2_Provider {
|
||||
|
||||
public $name = 'facebook';
|
||||
|
||||
protected $scope = 'email';
|
||||
|
||||
public function url_authorize()
|
||||
{
|
||||
return 'https://www.facebook.com/dialog/oauth';
|
||||
}
|
||||
|
||||
public function url_access_token()
|
||||
{
|
||||
return 'https://graph.facebook.com/oauth/access_token';
|
||||
}
|
||||
|
||||
public function url_user_details()
|
||||
{
|
||||
return 'https://graph.facebook.com/me';
|
||||
}
|
||||
|
||||
} // End OAuth_Provider_Facebook
|
44
modules/oauth/classes/Kohana/OAuth2/Provider/Google.php
Normal file
44
modules/oauth/classes/Kohana/OAuth2/Provider/Google.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php defined('SYSPATH') or die('No direct script access.');
|
||||
/**
|
||||
* OAuth Google Provider
|
||||
*
|
||||
* Documents for implementing Google OAuth can be found at
|
||||
* <http://code.google.com/apis/accounts/docs/OAuth.html>.
|
||||
* Individual Google APIs have separate documentation. A complete list is
|
||||
* available at <http://code.google.com/more/>.
|
||||
*
|
||||
* [!!] This class does not implement any Google API. It is only an
|
||||
* implementation of standard OAuth with Google as the service provider.
|
||||
*
|
||||
* @package Kohana/OAuth2
|
||||
* @category Provider
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2010 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
* @since 3.0.7
|
||||
*/
|
||||
class Kohana_OAuth2_Provider_Google extends OAuth2_Provider {
|
||||
|
||||
public $name = 'google';
|
||||
|
||||
protected $scope = 'openid email';
|
||||
|
||||
public function url_authorize()
|
||||
{
|
||||
return 'https://accounts.google.com/o/oauth2/auth';
|
||||
}
|
||||
|
||||
public function url_access_token()
|
||||
{
|
||||
return 'https://accounts.google.com/o/oauth2/token';
|
||||
}
|
||||
|
||||
public function url_user_details()
|
||||
{
|
||||
return 'https://www.googleapis.com/oauth2/v2/userinfo';
|
||||
}
|
||||
|
||||
} // End OAuth_Provider_Google
|
Reference in New Issue
Block a user