public function getUserInfo($accessToken=null, $cacheDuration=-1)
    {
        try {
            /** @var string $cacheKey */
            if($accessToken == null && !empty($at = $this->getAccessToken()))
                $accessToken = $at->token;
        } catch (Exception $e) {
            Yii::error($e->getMessage());
        }

        $userInfo = null;

        if(!empty($accessToken))
        {
            if($cacheDuration > 0 && Yii::$app->cache)
            {
                $cacheKey = "UserInfo_".sha1($accessToken);
                $userInfo = Yii::$app->cache->get($cacheKey);
            }

            if(empty($userInfo))
            {
                $header  = [
                    'Authorization' => 'Bearer ' . $accessToken
                ];
                try {
                    $userInfo = $this->api($this->userInfoUrl, 'GET', [], $header);
                } catch (Exception $e) {
                    Yii::info("Error when connect to Oauth server, We are trying to get UserInfo\n
                            with access-token: '$accessToken' \n
                            and message: " . $e->getMessage());
                    if($e instanceof InvalidResponseException) {
                        Yii::$app->user->logout();
                        $message = Yii::t('app', "Token expired. Please login again!");
                    } else {
                        $message = $e->getMessage();
                    }
                    throw new UnauthorizedHttpException($message, $e->getCode(), $e->getPrevious());
                }
                if($cacheDuration > 0 && Yii::$app->cache)
                {
                    Yii::$app->cache->set($cacheKey, $userInfo, $cacheDuration);
                }
            }
        }

        return $userInfo;
    }