You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-16Lines changed: 12 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@ OAuth.io PHP SDK
3
3
4
4
OAuth that just works !
5
5
6
-
This SDK allows you to use OAuth.io's server-side flow from a PHP backend, to handle access tokens from your server instead of directly from your front-end.
6
+
This SDK allows you to use OAuth.io from a PHP backend, to handle access tokens from your server instead of directly from your front-end.
7
7
8
-
You can use it with one of our front-end SDKs ([JavaScript][1], [PhoneGap][2], [iOs][3], [Android][4]), which will handle the user input for the OAuth flow.
9
-
10
-
The current version of the SDK is `0.2.0`. Older versions are deprecated.
8
+
The current version of the SDK is `0.3.0`. Older versions are deprecated.
11
9
12
10
You can also get nightlies by checking out our `develop` branch.
13
11
12
+
To get more information about this SDK and its method, please refer to its [reference documentation](https://oauth.io/docs/api-reference/server/php) on OAuth.io.
13
+
14
14
Features
15
15
--------
16
16
@@ -24,16 +24,13 @@ Common use-Case
24
24
25
25
You don't want to use APIs directly from the front-end, but rather through web-services inside your PHP backend.
26
26
27
-
Server-side flow
28
-
----------------
27
+
Installation
28
+
------------
29
29
30
-
To authenticate the user, you'll need to set your app's backend to **PHP** in your OAuth.io [dashboard](https://oauth.io/dashboard).
30
+
First of all, you'll need to set your app's backend to **PHP** in your OAuth.io [dashboard](https://oauth.io/dashboard).
31
31
32
32
This allows you to get a refresh token from the provider if available.
33
33
34
-
Installation
35
-
------------
36
-
37
34
You can install it through Composer by adding the following dependency to your composer.json :
38
35
39
36
```json
@@ -50,10 +47,10 @@ Then run in the console :
50
47
$ composer install
51
48
```
52
49
53
-
How to use it ?
54
-
---------------
50
+
Using the SDK
51
+
-------------
55
52
56
-
The `OAuth` class is stored in the `OAuth_io` namespace. You need to include it in your file like this (make sure you have required the Composer autoloader file):
53
+
The `OAuth` class is stored in the `OAuth_io` namespace. You need to include it in your file like this (make sure you have required the Composer autoloader file):
`$request_object` is an object that allows you to perform requests (see further down to learn how to), and that contains the user's credentials.
135
132
136
-
*Using the session to get a request object*
133
+
**Using the session to get a request object**
137
134
138
135
Usually, you'll want to make calls to the API several times while the user is connected to your app. Once you've authenticated the user once with a code, the session is automatically configured to work with the SDK.
139
136
@@ -143,7 +140,7 @@ Thus, you just need to do this to get a request object:
143
140
$request_object = $oauth->auth('the_provider');
144
141
```
145
142
146
-
*Saving credentials to re-generate a request object*
143
+
**Saving credentials to re-generate a request object**
147
144
148
145
You can also save the user's credentials to make requests in a cron. You can get the credentials array from a request object like this :
0 commit comments