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