protected function createToken($login) {
    $jwt = (new Builder())
            ->setIssuer($this->getTokenIssuer())
            ->setIssuedAt(time())
            ->setExpiration(time()+3600)
            ->set(self::AUTH_USER_NAME, $login)
            ->sign($this->getTokenSigner(), $this->key)
            ->getToken();
    return $jwt->__toString();
  }