public function getAccessToken($targetUri)
    {
        Validate::isString($targetUri, '$targetUri');

        $this->_sweepExpiredTokens();
        $scopeUri = $this->_createScopeUri($targetUri);

        if (array_key_exists($scopeUri, $this->_activeTokens)) {
            $activeToken = $this->_activeTokens[$scopeUri];

            return $activeToken->getWrapAccessTokenResult()->getAccessToken();
        }

        $wrapAccessTokenResult = $this->_wrapRestProxy->wrapAccessToken(
            $this->_wrapUri,
            $this->_wrapName,
            $this->_wrapPassword,
            $scopeUri
        );

        $expirationDateTime = new \DateTime('now');
        $expiresIn = intval($wrapAccessTokenResult->getExpiresIn() / 2);
        $expirationDateTime = $expirationDateTime->add(
            new \DateInterval('PT'.$expiresIn.'S')
        );

        $acquiredActiveToken = new ActiveToken($wrapAccessTokenResult);
        $acquiredActiveToken->setExpirationDateTime($expirationDateTime);
        $this->_activeTokens[$scopeUri] = $acquiredActiveToken;

        return $wrapAccessTokenResult->getAccessToken();
    }