Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
___________________________________

Light PHP wrapper for the OAuth 2.0
___________________________________
___________________________________
Light PHP wrapper for the OAuth 2.0
___________________________________


AUTHOR & CONTACT
Expand Down Expand Up @@ -46,6 +46,7 @@ See the GNU Lesser General Public License for more details.
How can I use it ?
==================

``` php
require('client.php');
require('GrantType/IGrantType.php');
require('GrantType/AuthorizationCode.php');
Expand Down Expand Up @@ -73,12 +74,14 @@ else
$response = $client->fetch('https://graph.facebook.com/me');
var_dump($response, $response['result']);
}
```

How can I add a new Grant Type ?
================================
Simply write a new class in the namespace OAuth2\GrantType. You can place the class file under GrantType.
Here is an example :

``` php
namespace OAuth2\GrantType;

/**
Expand Down Expand Up @@ -114,4 +117,4 @@ class MyCustomGrantType implements IGrantType

call the OAuth client getAccessToken with the grantType you defined in the GRANT_TYPE constant, As following :
$response = $client->getAccessToken(TOKEN_ENDPOINT, 'my_custom_grant_type', $params);

```