generate token for gandalf authentication