Public Member Functions | |
| __construct () | |
| __destruct () | |
| addClient ($client_id, $client_secret, $redirect_uri) | |
Protected Member Functions | |
| checkClientCredentials ($client_id, $client_secret=NULL) | |
| getRedirectUri ($client_id) | |
| getAccessToken ($oauth_token) | |
| setAccessToken ($oauth_token, $client_id, $expires, $scope=NULL) | |
| getSupportedGrantTypes () | |
| getAuthCode ($code) | |
| setAuthCode ($code, $client_id, $redirect_uri, $expires, $scope=NULL) | |
Private Member Functions | |
| handleException ($e) | |
Private Attributes | |
| $db | |
OAuth2 Library PDO DB Implementation.
Definition at line 18 of file PDOOAuth2.inc.
| __construct | ( | ) |
Overrides OAuth2::__construct().
Definition at line 25 of file PDOOAuth2.inc.
| __destruct | ( | ) |
Release DB connection during destruct.
Definition at line 38 of file PDOOAuth2.inc.
| addClient | ( | $ | client_id, | |
| $ | client_secret, | |||
| $ | redirect_uri | |||
| ) |
Little helper function to add a new client to the database.
Do NOT use this in production! This sample code stores the secret in plaintext!
| $client_id | Client identifier to be stored. | |
| $client_secret | Client secret to be stored. | |
| $redirect_uri | Redirect URI to be stored. |
Definition at line 63 of file PDOOAuth2.inc.
References handleException().
| checkClientCredentials | ( | $ | client_id, | |
| $ | client_secret = NULL | |||
| ) | [protected] |
Implements OAuth2::checkClientCredentials().
Do NOT use this in production! This sample code stores the secret in plaintext!
Reimplemented from OAuth2.
Definition at line 82 of file PDOOAuth2.inc.
References handleException().
| getAccessToken | ( | $ | oauth_token | ) | [protected] |
Implements OAuth2::getAccessToken().
Reimplemented from OAuth2.
Definition at line 124 of file PDOOAuth2.inc.
References handleException().
| getAuthCode | ( | $ | code | ) | [protected] |
Overrides OAuth2::getAuthCode().
Reimplemented from OAuth2.
Definition at line 169 of file PDOOAuth2.inc.
References handleException().
| getRedirectUri | ( | $ | client_id | ) | [protected] |
Implements OAuth2::getRedirectUri().
Reimplemented from OAuth2.
Definition at line 103 of file PDOOAuth2.inc.
References handleException().
| getSupportedGrantTypes | ( | ) | [protected] |
Overrides OAuth2::getSupportedGrantTypes().
Reimplemented from OAuth2.
Definition at line 160 of file PDOOAuth2.inc.
| handleException | ( | $ | e | ) | [private] |
Handle PDO exceptional cases.
Definition at line 45 of file PDOOAuth2.inc.
Referenced by addClient(), checkClientCredentials(), getAccessToken(), getAuthCode(), getRedirectUri(), setAccessToken(), and setAuthCode().
| setAccessToken | ( | $ | oauth_token, | |
| $ | client_id, | |||
| $ | expires, | |||
| $ | scope = NULL | |||
| ) | [protected] |
Implements OAuth2::setAccessToken().
Reimplemented from OAuth2.
Definition at line 142 of file PDOOAuth2.inc.
References handleException().
| setAuthCode | ( | $ | code, | |
| $ | client_id, | |||
| $ | redirect_uri, | |||
| $ | expires, | |||
| $ | scope = NULL | |||
| ) | [protected] |
Overrides OAuth2::setAuthCode().
Reimplemented from OAuth2.
Definition at line 187 of file PDOOAuth2.inc.
References handleException().
$db [private] |
Definition at line 20 of file PDOOAuth2.inc.
1.7.1