diff --git a/src/Auth/OAuth/Apple.php b/src/Auth/OAuth/Apple.php deleted file mode 100644 index 371bc5057f..0000000000 --- a/src/Auth/OAuth/Apple.php +++ /dev/null @@ -1,120 +0,0 @@ -appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=email&state=' . urlencode(json_encode($this->state)); - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('GET', 'https://appleid.apple.com/auth/token' . - 'client_id=' . urlencode($this->appID) . - '&client_secret=' . urlencode($this->appSecret) . - '&redirect_uri=' . urlencode($this->callback) . - '&code=' . urlencode($code) . - '&grant_type=authorization_token' - ); - - $accessToken = json_decode($accessToken, true); // - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file diff --git a/src/Auth/OAuth/Bitbucket.php b/src/Auth/OAuth/Bitbucket.php deleted file mode 100644 index 072e2f54f1..0000000000 --- a/src/Auth/OAuth/Bitbucket.php +++ /dev/null @@ -1,121 +0,0 @@ -appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=' . urlencode('profile email') . '&response_type=code'; - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('POST', 'https://www.googleapis.com/oauth2/v4/token?' . - 'client_id=' . urlencode($this->appID) . - '&redirect_uri=' . urlencode($this->callback) . - '&client_secret=' . urlencode($this->appSecret) . - '&code=' . urlencode($code) . - '&grant_type=authorization_code' - ); - - $accessToken = json_decode($accessToken, true); - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file diff --git a/src/Auth/OAuth/Gitlab.php b/src/Auth/OAuth/Gitlab.php deleted file mode 100644 index 34e461c83d..0000000000 --- a/src/Auth/OAuth/Gitlab.php +++ /dev/null @@ -1,121 +0,0 @@ -appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=' . urlencode('profile email') . '&response_type=code'; - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('POST', 'https://www.googleapis.com/oauth2/v4/token?' . - 'client_id=' . urlencode($this->appID) . - '&redirect_uri=' . urlencode($this->callback) . - '&client_secret=' . urlencode($this->appSecret) . - '&code=' . urlencode($code) . - '&grant_type=authorization_code' - ); - - $accessToken = json_decode($accessToken, true); - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file diff --git a/src/Auth/OAuth/Google.php b/src/Auth/OAuth/Google.php deleted file mode 100644 index 41c34ce368..0000000000 --- a/src/Auth/OAuth/Google.php +++ /dev/null @@ -1,121 +0,0 @@ -appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=' . urlencode('profile email') . '&response_type=code'; - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('POST', 'https://www.googleapis.com/oauth2/v4/token?' . - 'client_id=' . urlencode($this->appID) . - '&redirect_uri=' . urlencode($this->callback) . - '&client_secret=' . urlencode($this->appSecret) . - '&code=' . urlencode($code) . - '&grant_type=authorization_code' - ); - - $accessToken = json_decode($accessToken, true); - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file diff --git a/src/Auth/OAuth/Instagram.php b/src/Auth/OAuth/Instagram.php deleted file mode 100644 index 5ef9e00a1d..0000000000 --- a/src/Auth/OAuth/Instagram.php +++ /dev/null @@ -1,121 +0,0 @@ -appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=' . urlencode('profile email') . '&response_type=code'; - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('POST', 'https://www.googleapis.com/oauth2/v4/token?' . - 'client_id=' . urlencode($this->appID) . - '&redirect_uri=' . urlencode($this->callback) . - '&client_secret=' . urlencode($this->appSecret) . - '&code=' . urlencode($code) . - '&grant_type=authorization_code' - ); - - $accessToken = json_decode($accessToken, true); - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file diff --git a/src/Auth/OAuth/Microsoft.php b/src/Auth/OAuth/Microsoft.php deleted file mode 100644 index be71d4bcf1..0000000000 --- a/src/Auth/OAuth/Microsoft.php +++ /dev/null @@ -1,122 +0,0 @@ -version . '/dialog/oauth?client_id=' . urlencode($this->appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=email'; - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/oauth/access_token?' . - 'client_id=' . urlencode($this->appID) . - '&redirect_uri=' . urlencode($this->callback) . - '&client_secret=' . urlencode($this->appSecret) . - '&code=' . urlencode($code) - ); - - $accessToken = json_decode($accessToken, true); // - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file diff --git a/src/Auth/OAuth/Twitter.php b/src/Auth/OAuth/Twitter.php deleted file mode 100644 index 7223436a14..0000000000 --- a/src/Auth/OAuth/Twitter.php +++ /dev/null @@ -1,121 +0,0 @@ -appID) . '&redirect_uri=' . urlencode($this->callback) . '&scope=' . urlencode('profile email') . '&response_type=code'; - } - - /** - * @param string $code - * @return string - */ - public function getAccessToken(string $code):string - { - $accessToken = $this->request('POST', 'https://www.googleapis.com/oauth2/v4/token?' . - 'client_id=' . urlencode($this->appID) . - '&redirect_uri=' . urlencode($this->callback) . - '&client_secret=' . urlencode($this->appSecret) . - '&code=' . urlencode($code) . - '&grant_type=authorization_code' - ); - - $accessToken = json_decode($accessToken, true); - - if(isset($accessToken['access_token'])) { - return $accessToken['access_token']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserID(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['id'])) { - return $user['id']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserEmail(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['email'])) { - return $user['email']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return string - */ - public function getUserName(string $accessToken):string - { - $user = $this->getUser($accessToken); - - if(isset($user['name'])) { - return $user['name']; - } - - return ''; - } - - /** - * @param string $accessToken - * @return array - */ - protected function getUser(string $accessToken):array - { - if(empty($this->user)) { - $user = $this->request('GET', 'https://graph.facebook.com/' . $this->version . '/me?fields=email,name&access_token=' . urlencode($accessToken)); - - $this->user = json_decode($user, true); - } - - return $this->user; - } -} \ No newline at end of file