@@ 651-665 (lines=15) @@ | ||
648 | * @return \stdClass |
|
649 | * @throws TwitchSDKException |
|
650 | */ |
|
651 | public function authLoginURL($scope) |
|
652 | { |
|
653 | $this->checkConfig(); |
|
654 | ||
655 | $queryString = $this->helper->buildQueryString(array( |
|
656 | 'response_type' => 'code', |
|
657 | 'client_id' => $this->getConfigParam('client_id'), |
|
658 | 'redirect_uri' => $this->getConfigParam('redirect_uri'), |
|
659 | 'scope' => $scope, |
|
660 | )); |
|
661 | ||
662 | $auth = new Methods\Auth($this->request); |
|
663 | ||
664 | return $auth->getLoginURL($queryString); |
|
665 | } |
|
666 | ||
667 | /** |
|
668 | * Get authentication access token |
|
@@ 673-688 (lines=16) @@ | ||
670 | * @return \stdClass |
|
671 | * @throws TwitchSDKException |
|
672 | */ |
|
673 | public function authAccessTokenGet($code) |
|
674 | { |
|
675 | $this->checkConfig(); |
|
676 | ||
677 | $queryString = $this->helper->buildQueryString(array( |
|
678 | 'client_id' => $this->getConfigParam('client_id'), |
|
679 | 'client_secret' => $this->getConfigParam('client_secret'), |
|
680 | 'grant_type' => 'authorization_code', |
|
681 | 'redirect_uri' => $this->getConfigParam('redirect_uri'), |
|
682 | 'code' => $code, |
|
683 | )); |
|
684 | ||
685 | $auth = new Methods\Auth($this->request); |
|
686 | ||
687 | return $auth->getAccessToken($queryString); |
|
688 | } |
|
689 | ||
690 | /** |
|
691 | * Get the authenticated user |