getLtiProviderService()->searchByOauthKey($consumer_key); if ($provider === null) { throw new LtiOAuthException('LTI provider with given consumer key not found'); } return new LisOAuthConsumer($provider, $provider->getCallbackUrl()); } /** * @inheritDoc */ public function lookup_token($consumer, $token_type, $token) { return new OAuthToken($consumer, ''); } /** * @inheritDoc * @throws InvalidService * @throws InvalidServiceManagerException */ public function lookup_nonce($consumer, $token, $nonce, $timestamp) { /** @var NonceStore $store */ $store = $this->getSubService(self::OPTION_NONCE_STORE, NonceStore::class); return !$store->isValid($timestamp . '_' . $consumer->key . '_' . $nonce); } /** * @inheritDoc */ public function new_request_token($consumer, $callback = null) { return null; } /** * @inheritDoc */ public function new_access_token($token, $consumer, $verifier = null) { return null; } /** * @return LtiProviderService */ private function getLtiProviderService() { /** @noinspection PhpIncompatibleReturnTypeInspection */ return $this->getServiceLocator()->get(LtiProviderService::SERVICE_ID); } }