Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 43a8ba8

Browse files
committed
🚿 +default scopes
1 parent 529dc45 commit 43a8ba8

Some content is hidden

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

47 files changed

+169
-206
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"ext-curl": "*",
3131
"ext-json":"*",
3232
"ext-simplexml":"*",
33-
"chillerlan/php-oauth-core": "dev-main#e41c5f4e83f05b8aa4c6065b97e6889bc890422b",
33+
"chillerlan/php-oauth-core": "dev-main#59f122e88c19e44c9d1d31599e73f06d3ef67c90",
3434
"psr/http-client":"^1.0",
3535
"psr/http-message": "^1.0"
3636
},

examples/get-token/Amazon.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@
2525
$amazon = new Amazon($http, $storage, $options, $logger);
2626
$servicename = $amazon->serviceName;
2727

28-
$scopes = [
29-
Amazon::SCOPE_PROFILE,
30-
Amazon::SCOPE_PROFILE_USER_ID,
31-
Amazon::SCOPE_POSTAL_CODE,
32-
];
33-
3428
// step 2: redirect to the provider's login screen
3529
if(isset($_GET['login']) && $_GET['login'] === $servicename){
36-
header('Location: '.$amazon->getAuthURL(null, $scopes));
30+
header('Location: '.$amazon->getAuthURL());
3731
}
3832
// step 3: receive the access token
3933
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/BattleNet.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,9 @@
2525
$battlenet = new BattleNet($http, $storage, $options, $logger);
2626
$servicename = $battlenet->serviceName;
2727

28-
$scopes = [
29-
BattleNet::SCOPE_OPENID,
30-
BattleNet::SCOPE_PROFILE_D3,
31-
BattleNet::SCOPE_PROFILE_SC2,
32-
BattleNet::SCOPE_PROFILE_WOW,
33-
];
34-
3528
// step 2: redirect to the provider's login screen
3629
if(isset($_GET['login']) && $_GET['login'] === $servicename){
37-
header('Location: '.$battlenet->getAuthURL(null, $scopes));
30+
header('Location: '.$battlenet->getAuthURL());
3831
}
3932
// step 3: receive the access token
4033
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/Deezer.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,9 @@
2525
$deezer = new Deezer($http, $storage, $options, $logger);
2626
$servicename = $deezer->serviceName;
2727

28-
$scopes = [
29-
Deezer::SCOPE_BASIC,
30-
Deezer::SCOPE_EMAIL,
31-
Deezer::SCOPE_OFFLINE_ACCESS,
32-
Deezer::SCOPE_MANAGE_LIBRARY,
33-
Deezer::SCOPE_MANAGE_COMMUNITY,
34-
Deezer::SCOPE_DELETE_LIBRARY,
35-
Deezer::SCOPE_LISTENING_HISTORY,
36-
];
37-
3828
// step 2: redirect to the provider's login screen
3929
if(isset($_GET['login']) && $_GET['login'] === $servicename){
40-
header('Location: '.$deezer->getAuthURL(null, $scopes));
30+
header('Location: '.$deezer->getAuthURL());
4131
}
4232
// step 3: receive the access token
4333
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/DeviantArt.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@
2525
$deviantart = new DeviantArt($http, $storage, $options, $logger);
2626
$servicename = $deviantart->serviceName;
2727

28-
$scopes = [
29-
DeviantArt::SCOPE_BASIC,
30-
DeviantArt::SCOPE_BROWSE,
31-
];
32-
3328
// step 2: redirect to the provider's login screen
3429
if(isset($_GET['login']) && $_GET['login'] === $servicename){
35-
header('Location: '.$deviantart->getAuthURL(null, $scopes));
30+
header('Location: '.$deviantart->getAuthURL());
3631
}
3732
// step 3: receive the access token
3833
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/Discord.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,9 @@
2525
$discord = new Discord($http, $storage, $options, $logger);
2626
$servicename = $discord->serviceName;
2727

28-
$scopes = [
29-
Discord::SCOPE_CONNECTIONS,
30-
Discord::SCOPE_EMAIL,
31-
Discord::SCOPE_IDENTIFY,
32-
Discord::SCOPE_GUILDS,
33-
Discord::SCOPE_GUILDS_JOIN,
34-
Discord::SCOPE_GDM_JOIN,
35-
Discord::SCOPE_MESSAGES_READ,
36-
# Discord::SCOPE_RPC_API,
37-
# Discord::SCOPE_RPC_NOTIFICATIONS_READ,
38-
# Discord::SCOPE_BOT,
39-
# Discord::SCOPE_RPC,
40-
# Discord::SCOPE_WEBHOOK_INCOMING,
41-
];
42-
4328
// step 2: redirect to the provider's login screen
4429
if(isset($_GET['login']) && $_GET['login'] === $servicename){
45-
header('Location: '.$discord->getAuthURL(null, $scopes));
30+
header('Location: '.$discord->getAuthURL());
4631
}
4732
// step 3: receive the access token
4833
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/GitHub.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@
2525
$github = new GitHub($http, $storage, $options, $logger);
2626
$servicename = $github->serviceName;
2727

28-
$scopes = [
29-
GitHub::SCOPE_USER,
30-
GitHub::SCOPE_PUBLIC_REPO,
31-
GitHub::SCOPE_GIST,
32-
];
33-
3428
// step 2: redirect to the provider's login screen
3529
if(isset($_GET['login']) && $_GET['login'] === $servicename){
36-
header('Location: '.$github->getAuthURL(null, $scopes));
30+
header('Location: '.$github->getAuthURL());
3731
}
3832
// step 3: receive the access token
3933
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/Gitter.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@
2525
$gitter = new Gitter($http, $storage, $options, $logger);
2626
$servicename = $gitter->serviceName;
2727

28-
$scopes = [
29-
Gitter::SCOPE_FLOW,
30-
Gitter::SCOPE_PRIVATE,
31-
];
32-
3328
// step 2: redirect to the provider's login screen
3429
if(isset($_GET['login']) && $_GET['login'] === $servicename){
35-
header('Location: '.$gitter->getAuthURL(null, $scopes));
30+
header('Location: '.$gitter->getAuthURL());
3631
}
3732
// step 3: receive the access token
3833
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/Google.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,11 @@
2525
$google = new Google($http, $storage, $options, $logger);
2626
$servicename = $google->serviceName;
2727

28-
$scopes = [
29-
Google::SCOPE_EMAIL,
30-
Google::SCOPE_PROFILE,
31-
];
32-
3328
// step 2: redirect to the provider's login screen
3429
if(isset($_GET['login']) && $_GET['login'] === $servicename){
3530
$params = ['access_type' => 'online'];
3631

37-
header('Location: '.$google->getAuthURL($params, $scopes));
32+
header('Location: '.$google->getAuthURL($params));
3833
}
3934
// step 3: receive the access token
4035
elseif(isset($_GET['code']) && isset($_GET['state'])){

examples/get-token/Instagram.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,9 @@
2525
$instagram = new Instagram($http, $storage, $options, $logger);
2626
$servicename = $instagram->serviceName;
2727

28-
$scopes = [
29-
Instagram::SCOPE_BASIC,
30-
Instagram::SCOPE_COMMENTS,
31-
Instagram::SCOPE_RELATIONSHIPS,
32-
Instagram::SCOPE_LIKES,
33-
Instagram::SCOPE_PUBLIC_CONTENT,
34-
Instagram::SCOPE_FOLLOWER_LIST,
35-
];
36-
3728
// step 2: redirect to the provider's login screen
3829
if(isset($_GET['login']) && $_GET['login'] === $servicename){
39-
header('Location: '.$instagram->getAuthURL(null, $scopes));
30+
header('Location: '.$instagram->getAuthURL());
4031
}
4132
// step 3: receive the access token
4233
elseif(isset($_GET['code']) && isset($_GET['state'])){

0 commit comments

Comments
 (0)