forked from codemix/oauth2yii
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Wazelin/feature/client-scope
Implemented getClientScope()
- Loading branch information
Showing
4 changed files
with
28 additions
and
6 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
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<?php | ||
namespace OAuth2Yii\Storage; | ||
|
||
use \OAuth2\Storage\ClientInterface; | ||
use \OAuth2\Storage\ClientCredentialsInterface; | ||
use OAuth2\Storage\ClientCredentialsInterface; | ||
use OAuth2\Storage\ClientInterface; | ||
|
||
/** | ||
* Server storage for client data | ||
* | ||
* @author Michael Härtl <[email protected]> | ||
* | ||
* @method \OAuth2Yii\Interfaces\Client getStorage() | ||
*/ | ||
class CustomClient extends CustomStorage implements ClientInterface, ClientCredentialsInterface | ||
{ | ||
|
@@ -89,6 +91,13 @@ public function isPublicClient($client_id) | |
|
||
public function getClientScope($client_id) | ||
{ | ||
throw new \CException(501); | ||
$storage = $this->getStorage(); | ||
$client = $storage->queryClient($client_id); | ||
|
||
if (isset($client)) { | ||
return $storage->scopes($client); | ||
} | ||
|
||
return null; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
* Server storage for user data | ||
* | ||
* @author Michael Härtl <[email protected]> | ||
* | ||
* @method \OAuth2Yii\Interfaces\User getStorage() | ||
*/ | ||
class CustomUser extends CustomStorage implements UserCredentialsInterface | ||
{ | ||
|