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
        );
    }
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
        );
    }
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 ) ; }
Get common user uri associated to Lti user id

@param $id string Identifier of LTI user
@param $key string Oauth LTI consumer key
@return array|null
@throws \common_Exception
@throws \tao_models_classes_oauth_Exception
Get common user uri associated to Lti user id