Skip to content

fix: Return Type deprecations using annotations #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Riskio\OAuth2\Client\Provider;

use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -53,26 +54,41 @@ protected function baseUrl()
return 'https://' . $this->domain();
}

/**
* @return string
*/
public function getBaseAuthorizationUrl()
{
return $this->baseUrl() . '/authorize';
}

/**
* @return string
*/
public function getBaseAccessTokenUrl(array $params = [])
{
return $this->baseUrl() . '/oauth/token';
}

/**
* @return string
*/
public function getResourceOwnerDetailsUrl(AccessToken $token)
{
return $this->baseUrl() . '/userinfo';
}

/**
* @return array<int,string>
*/
public function getDefaultScopes()
{
return ['openid', 'email'];
}

/**
* @return void
*/
protected function checkResponse(ResponseInterface $response, $data)
{
if ($response->getStatusCode() >= 400) {
Expand All @@ -83,11 +99,18 @@ protected function checkResponse(ResponseInterface $response, $data)
}
}


/**
* @return ResourceOwnerInterface
*/
protected function createResourceOwner(array $response, AccessToken $token)
{
return new Auth0ResourceOwner($response);
}

/**
* @return string
*/
protected function getScopeSeparator()
{
return ' ';
Expand Down