Skip to content

Commit b098701

Browse files
Merge pull request #4 from samuelthomas2774/v3
v3
2 parents 99c84fd + ebd5091 commit b098701

File tree

128 files changed

+5976
-2119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+5976
-2119
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
indent_style = space
9+
indent_size = 4
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 Samuel Elliott
3+
Copyright (c) 2014-2019 Samuel Elliott
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

README.md

Lines changed: 196 additions & 315 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
2-
"name": "samuelthomas2774/oauth-client",
3-
"description": "An OAuth 2.0 Client library with built-in support for Facebook, Google, Microsoft, Yahoo, GitHub, LinkedIn & more.",
4-
"keywords": [ "oauth", "client", "oauth-client", "oauth2", "oauth2-client" ],
5-
"homepage": "https://samuelthomas2774.github.io/oauth-client/",
6-
"license": "MIT",
7-
"authors": [
8-
{
9-
"name": "Samuel Elliott",
10-
"email": "samuel@samuelthomas.ml",
11-
"homepage": "https://samuelthomas.ml"
12-
}
13-
],
14-
"autoload": {
15-
"files": [ "src/autoload.php" ]
16-
}
2+
"name": "samuelthomas2774/oauth-client",
3+
"description": "An OAuth 2.0 Client library with built-in support for Facebook, Google, Microsoft, Yahoo, GitHub, LinkedIn & more.",
4+
"keywords": ["oauth", "client", "oauth-client", "oauth2", "oauth2-client"],
5+
"homepage": "https://samuelthomas2774.github.io/oauth-client/",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Samuel Elliott",
10+
"email": "samuel+packagist@fancy.org.uk",
11+
"homepage": "https://samuelelliott.ml"
12+
}
13+
],
14+
"autoload": {
15+
"psr-4": {
16+
"OAuth2\\": "src/"
17+
}
18+
},
19+
"require": {
20+
"guzzlehttp/guzzle": "~6.0"
21+
}
1722
}

composer.lock

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
client.php
2+
3+
!all-2/client.php
4+
all-2/clients.php

examples/all-2/client.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
$clients = require __DIR__ . '/clients.php';
4+
5+
if (!isset($_SERVER['PATH_INFO'])) {
6+
echo 'No server.<br />';
7+
8+
foreach ($clients as $url => $client) {
9+
echo '<a href="' . $_SERVER['PHP_SELF'] . '/' . $url . '">' . $client['name'] . '</a><br />';
10+
}
11+
12+
return;
13+
}
14+
15+
$url = ltrim($_SERVER['PATH_INFO'], '/');
16+
17+
if (!isset($clients[$url])) {
18+
echo 'Unknown client "' . htmlentities($client_url) . '".<br />';
19+
return;
20+
}
21+
22+
return $clients[$url];

examples/all-2/clients-example.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/**
4+
* Copy this to clients.php and add your client IDs and secrets.
5+
*/
6+
7+
return [
8+
'speechmore' => [
9+
'name' => 'SpeechMore',
10+
'class' => \OAuth2\Providers\SpeechMore\SpeechMore::class,
11+
'id' => '...',
12+
'secret' => '...',
13+
'redirect_url' => 'https://' . $_SERVER['HTTP_HOST'] . '/oauth-client/examples/all-2/code.php/speechmore',
14+
'scope' => [
15+
'user:name',
16+
'user:avatar',
17+
],
18+
'options' => [
19+
'session_prefix' => 'speechmore_',
20+
],
21+
],
22+
];

0 commit comments

Comments
 (0)