PHP Class OAuthController

Inheritance: extends CI_Controller
显示文件 Open project: thomseddon/cakephp-oauth-server Class Usage Examples

Public Properties

Property Type Description
$components
$helpers
$uses

Public Methods

Method Description
authorize ( ) Example Authorize Endpoint
beforeFilter ( ) beforeFilter
blackHole ( string $type ) Blackhold callback
login ( ) Example Login Action
token ( ) Example Token Endpoint - this is where clients can retrieve an access token
userinfo ( ) Quick and dirty example implementation for protecetd resource

Private Methods

Method Description
validateRequest ( ) Check for any Security blackhole errors

Method Details

authorize() public method

Send users here first for authorization_code grant mechanism Required params (GET or POST): - response_type = code - client_id - redirect_url
public authorize ( )

beforeFilter() public method

beforeFilter
public beforeFilter ( )

blackHole() public method

OAuth requests will fail postValidation, so rather than disabling it completely if the request does fail this check we store it in $this->blackHoled and then when handling our forms we can use $this->validateRequest() to check if there were any errors and handle them with an exception. Requests that fail for reasons other than postValidation are handled here immediately using the best guess for if it was a form or OAuth
public blackHole ( string $type )
$type string

login() public method

Users must authorize themselves before granting the app authorization Allows login state to be maintained after authorization
public login ( )

token() public method

Grant types and parameters: 1) authorization_code - exchange code for token - code - client_id - client_secret 2) refresh_token - exchange refresh_token for token - refresh_token - client_id - client_secret 3) password - exchange raw details for token - username - password - client_id - client_secret
public token ( )

userinfo() public method

User accesible via $this->OAuth->user(); Single fields avaliable via $this->OAuth->user("id");
public userinfo ( )

Property Details

$components public_oe property

public $components

$helpers public_oe property

public $helpers

$uses public_oe property

public $uses