当我在 testflight 中使用删除方法触摸组时得到 403

Posted

技术标签:

【中文标题】当我在 testflight 中使用删除方法触摸组时得到 403【英文标题】:Got 403 when I touch group with delete method in testflight 【发布时间】:2017-09-11 05:51:58 【问题描述】:

从 testflight 中删除组后,我得到了带有删除方法的 url,如下所示:

curl 'https://itunesconnect.apple.com/testflight/v2/providers/team_id/apps/app_id/groups/969071cb-0615-4dac-8b1a-166fd7e89a98?deleteTesters=false' \
-XDELETE \
-H 'DNT: 1' \
-H 'Referer: https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/app_id/testflight?section=iosbuilds' \
-H 'Origin: https://itunesconnect.apple.com' \
-H 'Accept: application/json, text/plain, */*' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (Khtml, like Gecko) Version/10.1.2 Safari/603.3.8' \
-H 'X-Csrf-Itc: itc'

然后我用 fastlane 实现了这个过程,例如:

module Spaceship
  module TestFlight
    module GroupOperations

      ## TODO: Got 403 error
      def delete_group_for_app(apple_id, group_id, delete_testers)
        assert_required_params(__method__, binding)

        binding.pry
        url = "providers/#team_id/apps/#apple_id/groups/#group_id?deleteTesters=#delete_testers.to_s"
        refer = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/#apple_id/testflight?section=group&subsection=testers&id=#group_id"

        response = request(:delete) do |req|
          req.url url
          req.headers['Content-Type'] = 'application/json'
          req.headers['Referer'] = refer
          req.headers['Origin'] = 'https://itunesconnect.apple.com'
          req.headers['X-Requested-With'] = 'XMLHttpRequest'
          req.headers['X-Csrf-Itc'] = 'itc'
          req.headers['Accept'] = 'application/json, text/plain, */*'
          req.headers['Connection'] = 'keep-alive'
        end
        handle_response(response)
      end
    end

    Client.class_eval  include GroupOperations 
    class Client
      include GroupOperations
    end
  end
end

我登录后调用这个方法得到403,选择团队。

我想问的是itc对此的支持吗?如果支持,如何解决?

【问题讨论】:

【参考方案1】:

是的。支持。只要调整一下http头就可以了。

【讨论】:

以上是关于当我在 testflight 中使用删除方法触摸组时得到 403的主要内容,如果未能解决你的问题,请参考以下文章

Fastlane - 如何通过组将用户添加到 Testflight?

iTunes 连接 - TestFlight - 为测试组选择构建时出现控制台错误

Testflight 更新构建将删除数据

TestFlight 无法添加额外的测试人员

TestFlight 无法将构建添加到内部测试组

这是通过触摸导航栏中间的按钮来显示视图并通过触摸其他任何地方将其删除的好方法吗?