Skip to content

Commit

Permalink
Add missing abstract functions to TraktProvider class
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Feb 21, 2018
1 parent 5b036b7 commit 2af995a
Showing 1 changed file with 86 additions and 12 deletions.
98 changes: 86 additions & 12 deletions src/NNTmux/Trakt/Auth/TraktProvider.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?php
/**
* Created by PhpStorm.
* User: bwubs
* Date: 20/02/15
* Time: 22:12
*/

namespace NNTmux\Trakt\Auth;

use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use Psr\Http\Message\ResponseInterface;

class TraktProvider extends AbstractProvider
{
Expand Down Expand Up @@ -47,9 +43,9 @@ public function urlAuthorize()

public function getAuthorizationUrl($options = [])
{
$this->state = isset($options['state']) ? $options['state'] : md5(uniqid(rand(), true));
$this->state = $options['state'] ?? md5(uniqid(mt_rand(), true));
$params = [
'response_type' => isset($options['response_type']) ? $options['response_type'] : 'code',
'response_type' => $options['response_type'] ?? 'code',
'client_id' => $this->clientId,
'redirect_uri' => $this->redirectUri,
'state' => $this->state
Expand Down Expand Up @@ -80,6 +76,84 @@ public function urlUserDetails(AccessToken $token)
public function userDetails($response, AccessToken $token)
{
}


}


/**
* Returns the base URL for authorizing a client.
*
* Eg. https://oauth.service.com/authorize
*
* @return string
*/
public function getBaseAuthorizationUrl()
{
// TODO: Implement getBaseAuthorizationUrl() method.
}

/**
* Returns the base URL for requesting an access token.
*
* Eg. https://oauth.service.com/token
*
* @param array $params
*
* @return string
*/
public function getBaseAccessTokenUrl(array $params)
{
// TODO: Implement getBaseAccessTokenUrl() method.
}

/**
* Returns the URL for requesting the resource owner's details.
*
* @param AccessToken $token
*
* @return string
*/
public function getResourceOwnerDetailsUrl(AccessToken $token)
{
// TODO: Implement getResourceOwnerDetailsUrl() method.
}

/**
* Returns the default scopes used by this provider.
*
* This should only be the scopes that are required to request the details
* of the resource owner, rather than all the available scopes.
*
* @return array
*/
protected function getDefaultScopes()
{
// TODO: Implement getDefaultScopes() method.
}

/**
* Checks a provider response for errors.
*
* @throws IdentityProviderException
*
* @param ResponseInterface $response
* @param array|string $data Parsed response data
*
* @return void
*/
protected function checkResponse(ResponseInterface $response, $data)
{
// TODO: Implement checkResponse() method.
}

/**
* Generates a resource owner object from a successful resource owner
* details request.
*
* @param array $response
* @param AccessToken $token
*
* @return ResourceOwnerInterface
*/
protected function createResourceOwner(array $response, AccessToken $token)
{
// TODO: Implement createResourceOwner() method.
}}

0 comments on commit 2af995a

Please sign in to comment.