PHP Class OAuthController

Inheritance: extends CI_Controller
Afficher le fichier Open project: thomseddon/cakephp-oauth-server Class Usage Examples

Méthodes publiques

Свойство Type Description
$components
$helpers
$uses

Méthodes publiques

Méthode 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

Méthode Description
validateRequest ( ) Check for any Security blackhole errors

Method Details

authorize() public méthode

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 méthode

beforeFilter
public beforeFilter ( )

blackHole() public méthode

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 méthode

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

token() public méthode

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 méthode

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