diff options
| author | Brent Shaffer <bshafs@gmail.com> | 2012-12-20 20:09:08 +0400 |
|---|---|---|
| committer | Brent Shaffer <bshafs@gmail.com> | 2012-12-20 20:09:08 +0400 |
| commit | 8cb2360d9d76db082f6db9fbaccf05d1e2dcbb5b (patch) | |
| tree | 5fbe976d7e3a50539a81fc96533579aaefec3677 /README.md | |
| parent | 5e4d75e3b155c449ebe1d4a734568780d3e57d69 (diff) | |
| parent | 81ceb467b9b6745574a9ece4b3b2bbebf1e7c9b9 (diff) | |
| download | oauth2-server-php-0.2.tar.xz | |
Merge branch 'develop'v0.2
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -36,7 +36,7 @@ Before getting started, take a look at the [Oauth2 Demo Application](http://bren The quickest way to get started is to use the following code, plugging in your database information to the constructor of `OAuth2_Storage_Pdo`: - $storage = new OAuth2_Storage_Pdo($dsn, $username, $password); + $storage = new OAuth2_Storage_Pdo(array('dsn' => $dsn, 'username' => $username, 'password' => $password)); $server = new OAuth2_Server($storage); $server->addGrantType(new OAuth2_GrantType_UserCredentials($storage)); // or some other grant type. This is the simplest $server->handleGrantRequest(OAuth2_Request::createFromGlobals())->send(); @@ -45,7 +45,7 @@ Let's break this down line by line. The first line is how the OAuth2 data is sto There are several built in storage types, for your convenience. To use PDO Storage, instantiate the `OAuth2_Storage_Pdo` class and provide the database connection arguments: - $storage = new OAuth2_Storage_Pdo($dsn, $username, $password); + $storage = new OAuth2_Storage_Pdo(array('dsn' => $dsn, 'username' => $username, 'password' => $password)); $server = new OAuth2_Server($storage); The next step is to add a grant type. This example uses the "User Credentials" grant type, which grants a token based on |
