public function getToken( $service ) {
        if ( $this->isTokenLoaded( $service ) && !$this->isTokenExpired( $service ) ) {
            return $this->tokens[$service];
        }

        $tokenCacheKey = $this->getTokenCacheKey( $service );

        $cachedToken = $this->client->cache->get( $tokenCacheKey );
        if ( $cachedToken instanceof SecurityToken && !$cachedToken->hasExpired() ) {
            $this->tokens[$service] = $cachedToken; // save in memory

            return $cachedToken;
        }

        $this->tokens[$service] = $newToken = $this->retrieveToken( $service );
        $this->client->cache->set( $tokenCacheKey, $newToken, floor( $newToken->expiryTime - time() - 60 ) );

        return $newToken;
    }