【问题标题】:Android AccountKit.getCurrentAccount returns "API calls from the server require an appsecret_proof argument"Android AccountKit.getCurrentAccount 返回“来自服务器的 API 调用需要 appsecret_proof 参数”
【发布时间】:2016-04-16 20:07:19
【问题描述】:

我正在尝试 Facebook AccountKit,如下所示:https://developers.facebook.com/docs/accountkit/android/integrating

我通过以下方式启动 AccountKitAcitivity:

AccountKitConfiguration.AccountKitConfigurationBuilder configurationBuilder =
                new AccountKitConfiguration.AccountKitConfigurationBuilder(
                        LoginType.PHONE,
                        AccountKitActivity.ResponseType.TOKEN);
intent.putExtra(
AccountKitActivity.ACCOUNT_KIT_ACTIVITY_CONFIGURATION,
configurationBuilder.build());
startActivityForResult(intent, APP_REQUEST_CODE);

在我以“已验证”结尾完成 SMS 登录流程后,当我在活动中调用 AccountKit.getCurrentAccount(...) 时,我收到“来自服务器的 API 调用需要 appsecret_proof 参数”错误。

这只能通过关闭“用于服务器 API 调用的应用程序秘密证明”来“解决”。这会降低我的应用程序的安全性...有什么建议吗?

【问题讨论】:

  • 如果您找到了解决方案,但现在遇到了同样的问题,请告诉我。

标签: android facebook android-facebook


【解决方案1】:

如果您将“启用客户端访问令牌流程”设置为 true,那么您只会在登录流程结束时收到一个代码。您还需要设置 ResponseType.CODE。然后你可以在你的服务器上用它来交换一个令牌。

如果您将“需要应用程序机密”设置为 true,则 /me(以及其他一些)只能从服务器调用。 getCurrentAccount 本质上包装了 /me 端点,因此无法调用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-03
    • 1970-01-01
    • 2016-05-12
    • 2011-04-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多