protected function signIn($duration = null): Token
    {
        $options = $this->signInOptions($duration);

        $response = $this->client->request(
            'GET',
            self::SIGN_IN_URL,
            $options
        );

        $data = \GuzzleHttp\json_decode($response->getBody(), true);

        $token = $this->tokenFromResponse($data);
        $this->logger->info(
            'Retrieved a new mpx token {token} for user {username} that expires on {date}.',
            [
                'token' => $token->getValue(),
                'username' => $this->user->getMpxUsername(),
                'date' => date(DATE_ISO8601, $token->getExpiration()),
            ]
        );

        return $token;
    }