Skip to content
This repository was archived by the owner on Jul 28, 2022. It is now read-only.

Commit 42ea279

Browse files
committed
Updates README with new Authentication features
1 parent b60eb8a commit 42ea279

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ around the GitHub API v3. This is achieved using a number of methods:
1717
```php
1818
use GitHub\API\User\User;
1919

20-
// Setup the user, and authenticate
20+
// Setup the user, and authenticate (using basic HTTP auth)
2121
$user = new User();
2222
$user->setCredentials(new Authentication\Basic('username', 'password'));
2323
$user->login();
@@ -52,11 +52,10 @@ The following resources for the API are covered:
5252
### Requirements
5353

5454
* PHP 5.3+
55-
* Curl
5655

5756
### Dependancies
5857

59-
* [curl-php](https://github.com/dsyph3r/curl-php)
58+
* [Buzz](https://github.com/dsyph3r/Buzz)
6059

6160
### Installation
6261

@@ -88,10 +87,30 @@ Ideas from the excellent
8887

8988
## Authentication
9089

91-
At present only basic authentication is available. OAuth with be available soon.
90+
Authentication is supported for both basic HTTP and OAuth. OAuth is the recommened
91+
way to authenticate. (Note: This library does not actually deal with how you
92+
do the OAuth process to retrieve the access token. You must implement this your
93+
self. See [oauth2-php](https://github.com/dsyph3r/oauth2-php) lib for an
94+
implementation of this).
9295

9396
Authentication can be achieved as follows.
9497

98+
### OAuth
99+
100+
```php
101+
use GitHub\API\User\User;
102+
103+
$user = new User();
104+
$user->setCredentials(new Authentication\OAuth('access_token'));
105+
$user->login();
106+
107+
// Perform operations that require authentication ...
108+
109+
$user->logout();
110+
```
111+
112+
### Basic
113+
95114
```php
96115
use GitHub\API\User\User;
97116

0 commit comments

Comments
 (0)