| @@ 634-648 (lines=15) @@ | ||
| 631 | * @return \stdClass |
|
| 632 | * @throws TwitchException |
|
| 633 | */ |
|
| 634 | public function authLoginURL($scope) |
|
| 635 | { |
|
| 636 | $this->checkConfig(); |
|
| 637 | ||
| 638 | $queryString = $this->helper->buildQueryString(array( |
|
| 639 | 'response_type' => 'code', |
|
| 640 | 'client_id' => $this->getConfigParam('client_id'), |
|
| 641 | 'redirect_uri' => $this->getConfigParam('redirect_uri'), |
|
| 642 | 'scope' => $scope, |
|
| 643 | )); |
|
| 644 | ||
| 645 | $auth = new Methods\Auth($this->request); |
|
| 646 | ||
| 647 | return $auth->getLoginURL($queryString); |
|
| 648 | } |
|
| 649 | ||
| 650 | /** |
|
| 651 | * Get authentication access token |
|
| @@ 656-671 (lines=16) @@ | ||
| 653 | * @return \stdClass |
|
| 654 | * @throws TwitchException |
|
| 655 | */ |
|
| 656 | public function authAccessTokenGet($code) |
|
| 657 | { |
|
| 658 | $this->checkConfig(); |
|
| 659 | ||
| 660 | $queryString = $this->helper->buildQueryString(array( |
|
| 661 | 'client_id' => $this->getConfigParam('client_id'), |
|
| 662 | 'client_secret' => $this->getConfigParam('client_secret'), |
|
| 663 | 'grant_type' => 'authorization_code', |
|
| 664 | 'redirect_uri' => $this->getConfigParam('redirect_uri'), |
|
| 665 | 'code' => $code, |
|
| 666 | )); |
|
| 667 | ||
| 668 | $auth = new Methods\Auth($this->request); |
|
| 669 | ||
| 670 | return $auth->getAccessToken($queryString); |
|
| 671 | } |
|
| 672 | ||
| 673 | /** |
|
| 674 | * Get the authenticated user |
|