public function getUserId($id, $key)
    {
        $dataStore = new \tao_models_classes_oauth_DataStore();
        try {
            /** @var \core_kernel_classes_Resource $consumerResource */
            $consumerResource = $dataStore->findOauthConsumerResource($key);
        } catch (\tao_models_classes_oauth_Exception $e) {
            throw new \common_exception_NotFound($e->getMessage());
        }

        /** @var LtiUserService $service */
        $service = $this->getServiceLocator()->get(LtiUserService::SERVICE_ID);
        $userIdentifier = $service->getUserIdentifier($id, $consumerResource);

        if (is_null($userIdentifier)) {
            return null;
        }

        return array (
            'id' => $userIdentifier
        );
    }