def exchange_code(jwt_token:)
      json_body_str = JSON.generate('authToken' => jwt_token)

      response = HTTParty.post(
        "#{BASE_URL}/#{@config.env}/#{AUTH_CODE_PATH}",
        headers: {
          'Content-Type' => MIMETYPE_JSON,
          'Accept' => MIMETYPE_JSON,
          'Content-Length' => json_body_str.size.to_s,
          'Authorization' => authorization_header(body: json_body_str)
        },
        body: json_body_str
      )

      unless response.code == 200
        raise StandardError.new(
          "Failed to exchange JWT token. HTTP status: #{response.code}, response body: #{response.body}"
        )
      end

      res_payload = JSON.parse(response.body)
      extract_user_data(response: res_payload)
    end
def exchange_code(jwt_token:)
      json_body_str = JSON.generate('authToken' => jwt_token)

      response = HTTParty.post(
        "#{BASE_URL}/#{@config.env}/#{AUTH_CODE_PATH}",
        headers: {
          'Content-Type' => MIMETYPE_JSON,
          'Accept' => MIMETYPE_JSON,
          'Content-Length' => json_body_str.size.to_s,
          'Authorization' => authorization_header(body: json_body_str)
        },
        body: json_body_str
      )

      unless response.code == 200
        raise StandardError.new(
          "Failed to exchange JWT token. HTTP status: #{response.code}, response body: #{response.body}"
        )
      end

      res_payload = JSON.parse(response.body)
      extract_user_data(response: res_payload)
    end
Creates a client

 @param config [CivicSIPSdk::AppConfig] app_config that sets all the parameters of the client
 Exchange authorization code in the form of a JWT Token for the user data
 requested in the scope request.

 @param jwt_token [String] a JWT token that contains the authorization code
 @return [CivicSIPSdk::UserData] user data returned from SIP