aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php')
-rw-r--r--vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php35
1 files changed, 33 insertions, 2 deletions
diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php
index f953e4e8d..e135c2dd2 100644
--- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php
+++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php
@@ -9,12 +9,19 @@ use OAuth2\Storage\ClientCredentialsInterface;
/**
* @author Brent Shaffer <bshafs at gmail dot com>
*
- * @see OAuth2\ClientAssertionType_HttpBasic
+ * @see HttpBasic
*/
class ClientCredentials extends HttpBasic implements GrantTypeInterface
{
+ /**
+ * @var array
+ */
private $clientData;
+ /**
+ * @param ClientCredentialsInterface $storage
+ * @param array $config
+ */
public function __construct(ClientCredentialsInterface $storage, array $config = array())
{
/**
@@ -27,11 +34,21 @@ class ClientCredentials extends HttpBasic implements GrantTypeInterface
parent::__construct($storage, $config);
}
- public function getQuerystringIdentifier()
+ /**
+ * Get query string identifier
+ *
+ * @return string
+ */
+ public function getQueryStringIdentifier()
{
return 'client_credentials';
}
+ /**
+ * Get scope
+ *
+ * @return string|null
+ */
public function getScope()
{
$this->loadClientData();
@@ -39,6 +56,11 @@ class ClientCredentials extends HttpBasic implements GrantTypeInterface
return isset($this->clientData['scope']) ? $this->clientData['scope'] : null;
}
+ /**
+ * Get user id
+ *
+ * @return mixed
+ */
public function getUserId()
{
$this->loadClientData();
@@ -46,6 +68,15 @@ class ClientCredentials extends HttpBasic implements GrantTypeInterface
return isset($this->clientData['user_id']) ? $this->clientData['user_id'] : null;
}
+ /**
+ * Create access token
+ *
+ * @param AccessTokenInterface $accessToken
+ * @param mixed $client_id - client identifier related to the access token.
+ * @param mixed $user_id - user id associated with the access token
+ * @param string $scope - scopes to be stored in space-separated string.
+ * @return array
+ */
public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope)
{
/**