-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/* | ||
* OAuth2 Client Bundle | ||
* Copyright (c) KnpUniversity <http://knpuniversity.com/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace KnpU\OAuth2ClientBundle\Client\Provider; | ||
|
||
use Antalaron\DisqusOAuth2\DisqusResourceOwner; | ||
use KnpU\OAuth2ClientBundle\Client\OAuth2Client; | ||
use League\OAuth2\Client\Token\AccessToken; | ||
|
||
class DisqusClient extends OAuth2Client | ||
{ | ||
/** | ||
* @return DisqusResourceOwner|\League\OAuth2\Client\Provider\ResourceOwnerInterface | ||
*/ | ||
public function fetchUserFromToken(AccessToken $accessToken) | ||
{ | ||
return parent::fetchUserFromToken($accessToken); | ||
} | ||
|
||
/** | ||
* @return DisqusResourceOwner|\League\OAuth2\Client\Provider\ResourceOwnerInterface | ||
*/ | ||
public function fetchUser() | ||
{ | ||
return parent::fetchUser(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/DependencyInjection/Providers/DisqusProviderConfigurator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/* | ||
* OAuth2 Client Bundle | ||
* Copyright (c) KnpUniversity <http://knpuniversity.com/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace KnpU\OAuth2ClientBundle\DependencyInjection\Providers; | ||
|
||
use KnpU\OAuth2ClientBundle\Client\Provider\DisqusClient; | ||
use Symfony\Component\Config\Definition\Builder\NodeBuilder; | ||
|
||
class DisqusProviderConfigurator implements ProviderConfiguratorInterface | ||
{ | ||
public function buildConfiguration(NodeBuilder $node) | ||
{ | ||
// no custom options | ||
} | ||
|
||
public function getProviderClass(array $config) | ||
{ | ||
return 'Antalaron\DisqusOAuth2\Disqus'; | ||
} | ||
|
||
public function getProviderOptions(array $config) | ||
{ | ||
return [ | ||
'clientId' => $config['client_id'], | ||
'clientSecret' => $config['client_secret'], | ||
]; | ||
} | ||
|
||
public function getPackagistName() | ||
{ | ||
return 'antalaron/oauth2-disqus'; | ||
} | ||
|
||
public function getLibraryHomepage() | ||
{ | ||
return 'https://github.com/antalaron/oauth2-disqus'; | ||
} | ||
|
||
public function getProviderDisplayName() | ||
{ | ||
return 'Disqus'; | ||
} | ||
|
||
public function getClientClass(array $config) | ||
{ | ||
return DisqusClient::class; | ||
} | ||
} |