Enabled OAuth/OAuth2 logins
This commit is contained in:
32
modules/oauth/classes/Kohana/OAuth/Request/Access.php
Normal file
32
modules/oauth/classes/Kohana/OAuth/Request/Access.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
/**
|
||||
* OAuth Access Request
|
||||
*
|
||||
* @package Kohana/OAuth
|
||||
* @category Request
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2010 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
* @since 3.0.7
|
||||
*/
|
||||
class Kohana_OAuth_Request_Access extends OAuth_Request {
|
||||
|
||||
protected $name = 'access';
|
||||
|
||||
protected $required = array(
|
||||
'oauth_consumer_key' => TRUE,
|
||||
'oauth_token' => TRUE,
|
||||
'oauth_signature_method' => TRUE,
|
||||
'oauth_signature' => TRUE,
|
||||
'oauth_timestamp' => TRUE,
|
||||
'oauth_nonce' => TRUE,
|
||||
'oauth_verifier' => TRUE,
|
||||
'oauth_version' => TRUE,
|
||||
);
|
||||
|
||||
public function execute(array $options = NULL)
|
||||
{
|
||||
return OAuth_Response::factory(parent::execute($options));
|
||||
}
|
||||
|
||||
} // End OAuth_Request_Access
|
26
modules/oauth/classes/Kohana/OAuth/Request/Authorize.php
Normal file
26
modules/oauth/classes/Kohana/OAuth/Request/Authorize.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
/**
|
||||
* OAuth Authorization Request
|
||||
*
|
||||
* @package Kohana/OAuth
|
||||
* @category Request
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2010 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
* @since 3.0.7
|
||||
*/
|
||||
class Kohana_OAuth_Request_Authorize extends OAuth_Request {
|
||||
|
||||
protected $name = 'request';
|
||||
|
||||
// http://oauth.net/core/1.0/#rfc.section.6.2.1
|
||||
protected $required = array(
|
||||
'oauth_token' => TRUE,
|
||||
);
|
||||
|
||||
public function execute(array $options = NULL)
|
||||
{
|
||||
return Request::current()->redirect($this->as_url());
|
||||
}
|
||||
|
||||
} // End OAuth_Request_Authorize
|
27
modules/oauth/classes/Kohana/OAuth/Request/Exception.php
Normal file
27
modules/oauth/classes/Kohana/OAuth/Request/Exception.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php defined('SYSPATH') or die('No direct script access.');
|
||||
|
||||
class Kohana_OAuth_Request_Exception extends Kohana_OAuth_Exception {
|
||||
|
||||
/**
|
||||
* @var string response body
|
||||
*/
|
||||
protected $body;
|
||||
|
||||
public function __construct($message, array $variables = NULL, $code = 0, $body = NULL)
|
||||
{
|
||||
$this->body = $body;
|
||||
|
||||
return parent::__construct($message, $variables, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the response body.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
}
|
27
modules/oauth/classes/Kohana/OAuth/Request/Resource.php
Normal file
27
modules/oauth/classes/Kohana/OAuth/Request/Resource.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php defined('SYSPATH') OR die('No direct access allowed.');
|
||||
/**
|
||||
* OAuth Resource Request
|
||||
*
|
||||
* @package Kohana/OAuth
|
||||
* @category Request
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2010 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
* @since 3.0.7
|
||||
*/
|
||||
class Kohana_OAuth_Request_Resource extends OAuth_Request {
|
||||
|
||||
protected $name = 'resource';
|
||||
|
||||
// http://oauth.net/core/1.0/#rfc.section.7
|
||||
protected $required = array(
|
||||
'oauth_consumer_key' => TRUE,
|
||||
'oauth_token' => TRUE,
|
||||
'oauth_signature_method' => TRUE,
|
||||
'oauth_signature' => TRUE,
|
||||
'oauth_timestamp' => TRUE,
|
||||
'oauth_nonce' => TRUE,
|
||||
'oauth_version' => TRUE,
|
||||
);
|
||||
|
||||
} // End OAuth_Request_Resource
|
32
modules/oauth/classes/Kohana/OAuth/Request/Token.php
Normal file
32
modules/oauth/classes/Kohana/OAuth/Request/Token.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php defined('SYSPATH') or die('No direct script access.');
|
||||
/**
|
||||
* OAuth Token Request
|
||||
*
|
||||
* @package Kohana/OAuth
|
||||
* @category Request
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2010 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
* @since 3.0.7
|
||||
*/
|
||||
class Kohana_OAuth_Request_Token extends OAuth_Request {
|
||||
|
||||
protected $name = 'request';
|
||||
|
||||
// http://oauth.net/core/1.0/#rfc.section.6.3.1
|
||||
protected $required = array(
|
||||
'oauth_callback' => TRUE,
|
||||
'oauth_consumer_key' => TRUE,
|
||||
'oauth_signature_method' => TRUE,
|
||||
'oauth_signature' => TRUE,
|
||||
'oauth_timestamp' => TRUE,
|
||||
'oauth_nonce' => TRUE,
|
||||
'oauth_version' => TRUE,
|
||||
);
|
||||
|
||||
public function execute(array $options = NULL)
|
||||
{
|
||||
return OAuth_Response::factory(parent::execute($options));
|
||||
}
|
||||
|
||||
} // End OAuth_Request_Token
|
Reference in New Issue
Block a user