File tree 3 files changed +28
-4
lines changed
3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,16 @@ composer require chillerlan/php-oauth
95
95
Note: replace ` dev-main ` with a [ version constraint] ( https://getcomposer.org/doc/articles/versions.md#writing-version-constraints ) , e.g. ` ^1.0 ` - see [ releases] ( https://github.com/chillerlan/php-oauth/releases ) for valid versions.
96
96
97
97
98
+ ## Examples
99
+
100
+ There is [ the suite of get-token examples] ( https://php-oauth.readthedocs.io/en/main/Usage/Using-examples.html ) ,
101
+ which is mostly intended for development, and there are self-contained examples for a quickstart:
102
+
103
+ - [ OAuth1 example] ( https://github.com/chillerlan/php-oauth/tree/main/examples/example-oauth1.php )
104
+ - [ OAuth2 example] ( https://github.com/chillerlan/php-oauth/tree/main/examples/example-oauth2.php )
105
+
106
+
107
+
98
108
# Implemented Providers
99
109
100
110
<!-- TABLE-START -->
Original file line number Diff line number Diff line change @@ -284,7 +284,10 @@ class MyOAuth2Provider extends OAuth2Provider implements TokenInvalidate{
284
284
* ...
285
285
*/
286
286
287
- protected function sendTokenInvalidateRequest(string $url, array $body){
287
+ protected function sendTokenInvalidateRequest(
288
+ string $url,
289
+ array $body,
290
+ ):ResponseInterface{
288
291
289
292
$request = $this->requestFactory
290
293
->createRequest('POST', $url)
@@ -298,7 +301,10 @@ class MyOAuth2Provider extends OAuth2Provider implements TokenInvalidate{
298
301
return $this->http->sendRequest($request);
299
302
}
300
303
301
- protected function getInvalidateAccessTokenBodyParams(AccessToken $token, string $type):array{
304
+ protected function getInvalidateAccessTokenBodyParams(
305
+ AccessToken $token,
306
+ string $type,
307
+ ):array{
302
308
return [
303
309
// here, client_id and client_secret are set additionally
304
310
'client_id' => $this->options->key,
@@ -322,7 +328,10 @@ class MyOAuth2Provider extends OAuth2Provider implements TokenInvalidate{
322
328
* ...
323
329
*/
324
330
325
- public function invalidateAccessToken(AccessToken|null $token = null, string|null $type = null):bool{
331
+ public function invalidateAccessToken(
332
+ AccessToken|null $token = null,
333
+ string|null $type = null,
334
+ ):bool{
326
335
327
336
// a token was given
328
337
if($token !== null){
Original file line number Diff line number Diff line change 2
2
3
3
OAuth is not exactly trivial, and so is live testing an OAuth flow to make sure the implementation and all its details work as expected.
4
4
The examples - specifically [ the get-token examples] ( https://github.com/chillerlan/php-oauth/tree/main/examples/get-token ) -
5
- are abstracted and condensed as far as possible to make using them as convenient as it can get.
5
+ are abstracted and condensed to make using them as convenient as possible.
6
+
7
+ There are also 2 self-contained, fully working examples to illustrate the whole implementation without any overhead:
8
+
9
+ - [ OAuth1 example] ( https://github.com/chillerlan/php-oauth/tree/main/examples/example-oauth1.php )
10
+ - [ OAuth2 example] ( https://github.com/chillerlan/php-oauth/tree/main/examples/example-oauth2.php )
6
11
7
12
8
13
## Requirements
You can’t perform that action at this time.
0 commit comments