芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/midiatech/lib/Helper/McaasGrant.php
client = $this->server->getClientStorage()->get( $clientId, $clientSecret, null, $this->getIdentifier() ); if (($this->client instanceof ClientEntity) === false) { throw new InvalidClientException(); } return $this; } /** * Complete the client credentials grant * * @return string * * @throws */ public function completeFlow() { // Validate any scopes that are in the request (should always return default) $scopes = $this->validateScopes('', $this->client); // Create a new session $session = new SessionEntity($this->server); $session->setOwner('client', $this->client->getId()); $session->associateClient($this->client); // Generate an access token $accessToken = new AccessTokenEntity($this->server); $accessToken->setId(SecureKey::generate()); $accessToken->setExpireTime($this->getAccessTokenTTL() + time()); // Associate scopes with the session and access token foreach ($scopes as $scope) { $session->associateScope($scope); } foreach ($session->getScopes() as $scope) { $accessToken->associateScope($scope); } // Save everything $session->save(); $accessToken->setSession($session); $accessToken->save(); return $accessToken->getId(); } }