com web/doc-editor: Excluse secret from source: index.php php/oauth.php
| From: | Yannick Torres | Date: | Mon, 28 Jul 2014 22:50:03 +0000 |
| Subject: | com web/doc-editor: Excluse secret from source: index.php php/oauth.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-12657@lists.php.net to get a copy of this message | ||
Commit: 3bdbbb687e0f644bb7e1ce8e36a85de67f00423d
Author: Yannick Torrès <yannick.torres@gmail.com> Tue, 29 Jul 2014 00:50:03 +0200
Parents: 68fe9b4dfd283f382f6b89133b8fe36114fa2719
Branches: master
Link: http://git.php.net/?p=web/doc-editor.git;a=commitdiff;h=3bdbbb687e0f644bb7e1ce8e36a85de67f00423d
Log:
Excluse secret from source
Changed paths:
M index.php
M php/oauth.php
diff --git a/index.php b/index.php index ea8a68c..afecd3b 100755 --- a/index.php +++ b/index.php @@ -3,6 +3,7 @@ session_start(); require_once dirname(__FILE__) . '/php/html.templates.php'; +require_once dirname(__FILE__) . '/php/Conf.php'; require_once dirname(__FILE__) . '/php/oauth.php'; // Perm link management @@ -100,6 +101,8 @@ $jsVar .= "\nvar auth = {};\n"; // Log the user in if needed if (!isset($_SESSION['userID'])) { + $Conf = Config::getInstance()->getConf(); + // Init var if( !isset($_SESSION['oauth']) ) $_SESSION['oauth'] = array(); @@ -108,14 +111,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'instagram'; - $instagram = new Oauth_instagram(); + $instagram = new Oauth_instagram($Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientSecret']); $instagram->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'instagram' && isset($_GET['code']) ) { - $instagram = new Oauth_instagram(); + $instagram = new Oauth_instagram($Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientSecret']); $access_token = $instagram->RequestToken($_GET['code']); $jsVar .= " @@ -133,14 +136,15 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'github'; - $git = new Oauth_github(); + $git = new Oauth_github($Conf['GLOBAL_CONFIGURATION']['oauth.github.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.github.clientSecret']); $git->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'github' && isset($_GET['code']) ) { - $git = new Oauth_github(); + $git = new Oauth_github($Conf['GLOBAL_CONFIGURATION']['oauth.github.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.github.clientSecret']); + $access_token = $git->RequestToken($_GET['code']); $user = $git->getUserInfo($access_token); @@ -160,14 +164,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'stackoverflow'; - $stack = new Oauth_stackoverflow(); + $stack = new Oauth_stackoverflow($Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientSecret'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientKey']); $stack->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'stackoverflow' && isset($_GET['code']) ) { - $stack = new Oauth_stackoverflow(); + $stack = new Oauth_stackoverflow($Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientSecret'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientKey']); $access_token = $stack->RequestToken($_GET['code']); $user = $stack->getUserInfo($access_token); @@ -188,14 +192,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'facebook'; - $facebook = new Oauth_facebook(); + $facebook = new Oauth_facebook($Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientSecret']); $facebook->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'facebook' && isset($_GET['code']) ) { - $facebook = new Oauth_facebook(); + $facebook = new Oauth_facebook($Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientSecret']); $access_token = $facebook->RequestToken($_GET['code']); $user = $facebook->getUserInfo($access_token); @@ -217,14 +221,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'google'; - $google = new Oauth_google(); + $google = new Oauth_google($Conf['GLOBAL_CONFIGURATION']['oauth.google.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.google.clientSecret']); $google->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'google' && isset($_GET['code']) ) { - $google = new Oauth_google(); + $google = new Oauth_google($Conf['GLOBAL_CONFIGURATION']['oauth.google.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.google.clientSecret']); $access_token = $google->RequestToken($_GET['code']); $user = $google->getUserInfo($access_token); @@ -246,14 +250,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'linkedin'; - $linkedin = new Oauth_linkedin(); + $linkedin = new Oauth_linkedin($Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientSecret']); $linkedin->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'linkedin' && isset($_GET['code']) ) { - $linkedin = new Oauth_linkedin(); + $linkedin = new Oauth_linkedin($Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientSecret']); $access_token = $linkedin->RequestToken($_GET['code']); $user = $linkedin->getUserInfo($access_token); diff --git a/php/oauth.php b/php/oauth.php index d7bf1f9..5cac076 100644 --- a/php/oauth.php +++ b/php/oauth.php @@ -1,5 +1,4 @@ <?php - class Oauth_github { public $redirect_uri; @@ -9,21 +8,15 @@ class Oauth_github public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://github.com/login/oauth/authorize'; $this->tokenURL = 'https://github.com/login/oauth/access_token'; $this->userInfoURL = 'https://api.github.com/user'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = 'cd59e5a636c4f0de0f79'; - //$this->clientSecret = '4ef43189760ae9889539507a76f3b5f7aea02c77'; - - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '5ca48f6dadff47ffe5b4'; - $this->clientSecret = '0f6b44d38340150e58d17d5d45d31c55a5130ce7'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -95,23 +88,17 @@ class Oauth_stackoverflow public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret, $clientKey) { $this->serveurURL = 'https://stackexchange.com/oauth'; $this->tokenURL = 'https://stackexchange.com/oauth/access_token'; $this->userInfoURL = 'https://api.stackexchange.com/me'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = '3333'; - //$this->clientSecret = '8y7KkcWXYil*DOGMF)bL*g(('; - //$this->clientKey = 'Peqo3*0QVMQbPpw*YvKkrw(('; - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '3338'; - $this->clientSecret = 'tPjwsBG6Qawkr7eOgl)Luw(('; - $this->clientKey = 'taHVAxpz*cMJyTCHACkixA(('; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; + $this->clientKey = $clientKey; } public function RequestCode() { @@ -184,21 +171,16 @@ class Oauth_facebook public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://www.facebook.com/dialog/oauth'; $this->tokenURL = 'https://graph.facebook.com/oauth/access_token'; $this->userInfoURL = 'https://graph.facebook.com/me'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = '687771861310348'; - //$this->clientSecret = '482d1d6df9981e3e6d8350da8a166edc'; - - // Prod + // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '128417830579090'; - $this->clientSecret = '2e18fd9adfc219ddb85031fe08f481d9'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -271,21 +253,16 @@ class Oauth_google public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://accounts.google.com/o/oauth2/auth'; $this->tokenURL = 'https://accounts.google.com/o/oauth2/token'; $this->userInfoURL = 'https://www.googleapis.com/plus/v1/people/me'; - // Dev - OK - //$this->redirect_uri = 'http://localhost/'; - //$this->clientID = '175713024907-23ur2ii7e6eupirce8u72c4su9c682dq.apps.googleusercontent.com'; - //$this->clientSecret = '_Lm3fJcvS8Ubct4z_dJ3OJzq'; - // Prod $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '100526866357.apps.googleusercontent.com'; - $this->clientSecret = 'FcKf36077Rco6S2xvdad9-WG'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -359,22 +336,17 @@ class Oauth_linkedin public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://www.linkedin.com/uas/oauth2/authorization'; $this->tokenURL = 'https://www.linkedin.com/uas/oauth2/accessToken'; $this->userInfoURLEmail = 'https://api.linkedin.com/v1/people/~/email-address'; $this->userInfoURL = 'https://api.linkedin.com/v1/people/~:(firstName,lastName)'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = '77jy88t0ioyi51'; - //$this->clientSecret = 'FglhuuI0g7IjiYZQ'; - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '77x6uic1m4ilry'; - $this->clientSecret = 'KFsgABtaBLuWX3sf'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -469,21 +441,16 @@ class Oauth_instagram public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://api.instagram.com/oauth/authorize/'; $this->tokenURL = 'https://api.instagram.com/oauth/access_token'; $this->userInfoURL = 'https://api.instagram.com/v1/user'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = 'a6f32c43608648c2aca7ab29d2300dd4'; - //$this->clientSecret = 'c5a9f895cdc9414ea5a8d82cfddfd975'; - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '3e83439913b441829396fd009dcee1b3'; - $this->clientSecret = '01d24b054bda44c4946eeca3629b3f8d'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() {
diff --git a/index.php b/index.php index ea8a68c..afecd3b 100755 --- a/index.php +++ b/index.php @@ -3,6 +3,7 @@ session_start(); require_once dirname(__FILE__) . '/php/html.templates.php'; +require_once dirname(__FILE__) . '/php/Conf.php'; require_once dirname(__FILE__) . '/php/oauth.php'; // Perm link management @@ -100,6 +101,8 @@ $jsVar .= "\nvar auth = {};\n"; // Log the user in if needed if (!isset($_SESSION['userID'])) { + $Conf = Config::getInstance()->getConf(); + // Init var if( !isset($_SESSION['oauth']) ) $_SESSION['oauth'] = array(); @@ -108,14 +111,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'instagram'; - $instagram = new Oauth_instagram(); + $instagram = new Oauth_instagram($Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientSecret']); $instagram->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'instagram' && isset($_GET['code']) ) { - $instagram = new Oauth_instagram(); + $instagram = new Oauth_instagram($Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.instagram.clientSecret']); $access_token = $instagram->RequestToken($_GET['code']); $jsVar .= " @@ -133,14 +136,15 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'github'; - $git = new Oauth_github(); + $git = new Oauth_github($Conf['GLOBAL_CONFIGURATION']['oauth.github.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.github.clientSecret']); $git->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'github' && isset($_GET['code']) ) { - $git = new Oauth_github(); + $git = new Oauth_github($Conf['GLOBAL_CONFIGURATION']['oauth.github.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.github.clientSecret']); + $access_token = $git->RequestToken($_GET['code']); $user = $git->getUserInfo($access_token); @@ -160,14 +164,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'stackoverflow'; - $stack = new Oauth_stackoverflow(); + $stack = new Oauth_stackoverflow($Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientSecret'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientKey']); $stack->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'stackoverflow' && isset($_GET['code']) ) { - $stack = new Oauth_stackoverflow(); + $stack = new Oauth_stackoverflow($Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientSecret'], $Conf['GLOBAL_CONFIGURATION']['oauth.stackoverflow.clientKey']); $access_token = $stack->RequestToken($_GET['code']); $user = $stack->getUserInfo($access_token); @@ -188,14 +192,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'facebook'; - $facebook = new Oauth_facebook(); + $facebook = new Oauth_facebook($Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientSecret']); $facebook->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'facebook' && isset($_GET['code']) ) { - $facebook = new Oauth_facebook(); + $facebook = new Oauth_facebook($Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.facebook.clientSecret']); $access_token = $facebook->RequestToken($_GET['code']); $user = $facebook->getUserInfo($access_token); @@ -217,14 +221,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'google'; - $google = new Oauth_google(); + $google = new Oauth_google($Conf['GLOBAL_CONFIGURATION']['oauth.google.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.google.clientSecret']); $google->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'google' && isset($_GET['code']) ) { - $google = new Oauth_google(); + $google = new Oauth_google($Conf['GLOBAL_CONFIGURATION']['oauth.google.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.google.clientSecret']); $access_token = $google->RequestToken($_GET['code']); $user = $google->getUserInfo($access_token); @@ -246,14 +250,14 @@ if (!isset($_SESSION['userID'])) $_SESSION['oauth']['identService'] = 'linkedin'; - $linkedin = new Oauth_linkedin(); + $linkedin = new Oauth_linkedin($Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientSecret']); $linkedin->RequestCode(); } if( isset($_SESSION['oauth']['identService']) && $_SESSION['oauth']['identService'] == 'linkedin' && isset($_GET['code']) ) { - $linkedin = new Oauth_linkedin(); + $linkedin = new Oauth_linkedin($Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientID'], $Conf['GLOBAL_CONFIGURATION']['oauth.linkedin.clientSecret']); $access_token = $linkedin->RequestToken($_GET['code']); $user = $linkedin->getUserInfo($access_token); diff --git a/php/oauth.php b/php/oauth.php index d7bf1f9..5cac076 100644 --- a/php/oauth.php +++ b/php/oauth.php @@ -1,5 +1,4 @@ <?php - class Oauth_github { public $redirect_uri; @@ -9,21 +8,15 @@ class Oauth_github public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://github.com/login/oauth/authorize'; $this->tokenURL = 'https://github.com/login/oauth/access_token'; $this->userInfoURL = 'https://api.github.com/user'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = 'cd59e5a636c4f0de0f79'; - //$this->clientSecret = '4ef43189760ae9889539507a76f3b5f7aea02c77'; - - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '5ca48f6dadff47ffe5b4'; - $this->clientSecret = '0f6b44d38340150e58d17d5d45d31c55a5130ce7'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -95,23 +88,17 @@ class Oauth_stackoverflow public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret, $clientKey) { $this->serveurURL = 'https://stackexchange.com/oauth'; $this->tokenURL = 'https://stackexchange.com/oauth/access_token'; $this->userInfoURL = 'https://api.stackexchange.com/me'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = '3333'; - //$this->clientSecret = '8y7KkcWXYil*DOGMF)bL*g(('; - //$this->clientKey = 'Peqo3*0QVMQbPpw*YvKkrw(('; - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '3338'; - $this->clientSecret = 'tPjwsBG6Qawkr7eOgl)Luw(('; - $this->clientKey = 'taHVAxpz*cMJyTCHACkixA(('; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; + $this->clientKey = $clientKey; } public function RequestCode() { @@ -184,21 +171,16 @@ class Oauth_facebook public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://www.facebook.com/dialog/oauth'; $this->tokenURL = 'https://graph.facebook.com/oauth/access_token'; $this->userInfoURL = 'https://graph.facebook.com/me'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = '687771861310348'; - //$this->clientSecret = '482d1d6df9981e3e6d8350da8a166edc'; - - // Prod + // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '128417830579090'; - $this->clientSecret = '2e18fd9adfc219ddb85031fe08f481d9'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -271,21 +253,16 @@ class Oauth_google public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://accounts.google.com/o/oauth2/auth'; $this->tokenURL = 'https://accounts.google.com/o/oauth2/token'; $this->userInfoURL = 'https://www.googleapis.com/plus/v1/people/me'; - // Dev - OK - //$this->redirect_uri = 'http://localhost/'; - //$this->clientID = '175713024907-23ur2ii7e6eupirce8u72c4su9c682dq.apps.googleusercontent.com'; - //$this->clientSecret = '_Lm3fJcvS8Ubct4z_dJ3OJzq'; - // Prod $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '100526866357.apps.googleusercontent.com'; - $this->clientSecret = 'FcKf36077Rco6S2xvdad9-WG'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -359,22 +336,17 @@ class Oauth_linkedin public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://www.linkedin.com/uas/oauth2/authorization'; $this->tokenURL = 'https://www.linkedin.com/uas/oauth2/accessToken'; $this->userInfoURLEmail = 'https://api.linkedin.com/v1/people/~/email-address'; $this->userInfoURL = 'https://api.linkedin.com/v1/people/~:(firstName,lastName)'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = '77jy88t0ioyi51'; - //$this->clientSecret = 'FglhuuI0g7IjiYZQ'; - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '77x6uic1m4ilry'; - $this->clientSecret = 'KFsgABtaBLuWX3sf'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() { @@ -469,21 +441,16 @@ class Oauth_instagram public $serveurURL; public $userInfoURL; - public function __construct() { + public function __construct($clientID, $clientSecret) { $this->serveurURL = 'https://api.instagram.com/oauth/authorize/'; $this->tokenURL = 'https://api.instagram.com/oauth/access_token'; $this->userInfoURL = 'https://api.instagram.com/v1/user'; - // Dev - OK - //$this->redirect_uri = 'http://phpdoc.local/'; - //$this->clientID = 'a6f32c43608648c2aca7ab29d2300dd4'; - //$this->clientSecret = 'c5a9f895cdc9414ea5a8d82cfddfd975'; - // Prod - OK $this->redirect_uri = 'https://edit.php.net/'; - $this->clientID = '3e83439913b441829396fd009dcee1b3'; - $this->clientSecret = '01d24b054bda44c4946eeca3629b3f8d'; + $this->clientID = $clientID; + $this->clientSecret = $clientSecret; } public function RequestCode() {