Enabled OAuth/OAuth2 logins
This commit is contained in:
20
modules/oauth/classes/Kohana/OAuth2/Request/Authorize.php
Normal file
20
modules/oauth/classes/Kohana/OAuth2/Request/Authorize.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* OAuth Request Authorize
|
||||
*
|
||||
* @package Kohana/OAuth2
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
abstract class Kohana_OAuth2_Request_Authorize extends OAuth2_Request {
|
||||
|
||||
protected $name = 'authorize';
|
||||
|
||||
public function execute(array $options = NULL)
|
||||
{
|
||||
return Request::current()->redirect($this->as_url());
|
||||
}
|
||||
|
||||
}
|
19
modules/oauth/classes/Kohana/OAuth2/Request/Resource.php
Normal file
19
modules/oauth/classes/Kohana/OAuth2/Request/Resource.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* OAuth Request Resource
|
||||
*
|
||||
* @package Kohana/OAuth2
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
abstract class Kohana_OAuth2_Request_Resource extends OAuth2_Request {
|
||||
|
||||
protected $name = 'resource';
|
||||
protected $auth_params = '/^(access_token|redirect_uri)/';
|
||||
|
||||
public $send_header = 'OAuth';
|
||||
public $body = '';
|
||||
|
||||
}
|
22
modules/oauth/classes/Kohana/OAuth2/Request/Token.php
Normal file
22
modules/oauth/classes/Kohana/OAuth2/Request/Token.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* OAuth Request Token
|
||||
*
|
||||
* @package Kohana/OAuth2
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
abstract class Kohana_OAuth2_Request_Token extends OAuth2_Request {
|
||||
|
||||
protected $auth_params = '/^(grant_type|code|client_id|client_secret|redirect_uri)$/';
|
||||
|
||||
protected $name = 'token';
|
||||
|
||||
public function execute(array $options = NULL)
|
||||
{
|
||||
return OAuth_Response::factory(parent::execute($options));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user