澳门大阳城

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

OAuth2 Class Reference

Inheritance diagram for OAuth2:

List of all members.

Public Member Functions

 getVariable ($name, $default=NULL)
 setVariable ($name, $value)
 __construct ($config=array())
 verifyAccessToken ($scope=NULL, $exit_not_present=TRUE, $exit_invalid=TRUE, $exit_expired=TRUE, $exit_scope=TRUE, $realm=NULL)
 grantAccessToken ()
 getAuthorizeParams ()
 finishClientAuthorization ($is_authorized, $params=array())

Protected Member Functions

 checkClientCredentials ($client_id, $client_secret=NULL)
 getRedirectUri ($client_id)
 getAccessToken ($oauth_token)
 setAccessToken ($oauth_token, $client_id, $expires, $scope=NULL)
 getSupportedGrantTypes ()
 getSupportedAuthResponseTypes ()
 getSupportedScopes ()
 checkRestrictedAuthResponseType ($client_id, $response_type)
 checkRestrictedGrantType ($client_id, $grant_type)
 getAuthCode ($code)
 setAuthCode ($code, $client_id, $redirect_uri, $expires, $scope=NULL)
 checkUserCredentials ($client_id, $username, $password)
 checkAssertion ($client_id, $assertion_type, $assertion)
 getRefreshToken ($refresh_token)
 setRefreshToken ($refresh_token, $client_id, $expires, $scope=NULL)
 unsetRefreshToken ($refresh_token)
 checkNoneAccess ($client_id)
 getDefaultAuthenticationRealm ()
 getClientCredentials ()
 createAccessToken ($client_id, $scope=NULL)
 genAccessToken ()
 genAuthCode ()

Protected Attributes

 $conf = array()

Private Member Functions

 checkScope ($required_scope, $available_scope)
 getAccessTokenParams ()
 doRedirectUriCallback ($redirect_uri, $params)
 buildUri ($uri, $params)
 createAuthCode ($client_id, $redirect_uri, $scope=NULL)
 getAuthorizationHeader ()
 sendJsonHeaders ()
 errorDoRedirectUriCallback ($redirect_uri, $error, $error_description=NULL, $error_uri=NULL, $state=NULL)
 errorJsonResponse ($http_status_code, $error, $error_description=NULL, $error_uri=NULL)
 errorWWWAuthenticateResponseHeader ($http_status_code, $realm, $error, $error_description=NULL, $error_uri=NULL, $scope=NULL)

Detailed Description

OAuth2.0 draft v10 server-side implementation.

Author:
Originally written by Tim Ridgely <tim.ridgely@gmail.com>.
Updated to draft v10 by Aaron Parecki <aaron@parecki.com>.
Debug, coding style clean up and documented by Edison Wong <hswong3i@pantarei-design.com>.

Definition at line 354 of file OAuth2.inc.


Constructor & Destructor Documentation

__construct ( config = array()  ) 

Creates an OAuth2.0 server-side instance.

Parameters:
$config An associative array as below:

  • access_token_lifetime: (optional) The lifetime of access token in seconds.
  • auth_code_lifetime: (optional) The lifetime of authorization code in seconds.
  • refresh_token_lifetime: (optional) The lifetime of refresh token in seconds.
  • display_error: (optional) Whether to show verbose error messages in the response.

Definition at line 834 of file OAuth2.inc.

References setVariable().


Member Function Documentation

getVariable ( name,
default = NULL 
)

Returns a persistent variable.

To avoid problems, always use lower case for persistent variable names.

Parameters:
$name The name of the variable to return.
$default The default value to use if this variable has never been set.
Returns:
The value of the variable.

Definition at line 374 of file OAuth2.inc.

Referenced by createAccessToken(), createAuthCode(), errorDoRedirectUriCallback(), errorJsonResponse(), and errorWWWAuthenticateResponseHeader().

setVariable ( name,
value 
)

Sets a persistent variable.

To avoid problems, always use lower case for persistent variable names.

Parameters:
$name The name of the variable to set.
$value The value to set.

Definition at line 388 of file OAuth2.inc.

Referenced by __construct(), and grantAccessToken().


Member Data Documentation

$conf = array() [protected]

Array of persistent variables stored.

Definition at line 359 of file OAuth2.inc.


The documentation for this class was generated from the following file:
Generated on Tue Jan 25 2011 17:54:04 for oauth2-php by  doxygen 1.7.1
【网站地图】