This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', TRUE); | |
ini_set('display_startup_errors', TRUE); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
class Model_Bla extends ORM { | |
public function rules() | |
{ | |
return array( | |
'phone_one' => array( | |
array('at_least', array($this, 1, array('phone_one', 'phone_two', 'phone_three'))), | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Validation(6) { | |
protected _bound => array(4) ( | |
":validation" => object Validation(6) { | |
*RECURSION* | |
} | |
":data" => array(5) ( | |
"client_id" => string(4) "test" | |
"response_type" => string(4) "code" | |
"redirect_uri" => string(30) "http://wk01-lmst.managedit.ie/" | |
"state" => NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($request->method() == Request::GET) | |
{ | |
// Basic Request Validation | |
$params = $this->_get_authorize_params($request); | |
$validation = Validation::factory($params) | |
->rule('client_id', 'not_empty') | |
->rule('client_id', 'regex', array(':value', OAuth2::CLIENT_ID_REGEXP)) | |
->rule('response_type', 'not_empty') | |
->rule('response_type', 'regex', array(':value', OAuth2::RESPONSE_TYPE_REGEXP)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* | |
* | |
* @package OAuth2 | |
* @category Library | |
* @author Managed I.T. | |
* @copyright (c) 2011 Managed I.T. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* | |
* | |
* @package OAuth2 | |
* @category Library | |
* @author Managed I.T. | |
* @copyright (c) 2011 Managed I.T. | |
*/ | |
class OAuth2 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* | |
* | |
* @package OAuth2 | |
* @category Library | |
* @author Managed I.T. | |
* @copyright (c) 2011 Managed I.T. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/oauth2/authorize?response_type=code&client_id=[CLIENT_ID]&redirect_uri=[REDIRECT_URI] | |
/oauth2/authorize?response_type=token&client_id=[CLIENT_ID]&redirect_uri=[REDIRECT_URI] | |
/oauth2/token?client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&redirect_uri=[REDIRECT_URI]&grant_type=authorization_code&code=[CODE] | |
/oauth2/token?client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&redirect_uri=[REDIRECT_URI]&grant_type=refresh_token&refresh_token=[REFRESH_TOKEN] | |
/protected/resource?client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&access_token=[ACCESS_TOKEN] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* | |
* @package API | |
* @category Library | |
* @author Managed I.T. | |
* @copyright (c) 2011 Managed I.T. | |
* @license https://github.com/managedit/kohana-api/blob/master/LICENSE.md | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'oauth2' | |
require 'pp' | |
client = OAuth2::Client.new('test', 'test', :site => 'http://localhost/', :authorize_url => 'http://localhost/oauth2/authorize', :token_url => 'http://localhost/oauth2/token') | |
puts client.auth_code.authorize_url(:redirect_uri => 'http://localhost/') | |
puts "And the code is?" |
OlderNewer