gpt4 book ai didi

php - 在服务器端从 Android 验证用户

转载 作者:行者123 更新时间:2023-11-29 00:24:22 24 4
gpt4 key购买 nike

我的问题如下:


1. The User signs-in on the Android App using the Google+ API

2. The User wants to submit content (e.g. a video), so he calls a PHP from the App script with all the post variables (video_name, creator, video_description, video_url)

3. The Server stores everything in a MySQL Database


问题是 2 中的部分。当服务器存储“创建者”名称时


创建者 = Google Plus 名称


因为有人可以反编译应用程序并使用自定义 POST 变量构建 POST 请求,因此“黑客”可以输入任何名称作为创建者姓名。

如何当用户仅在 Android 应用程序中进行身份验证而未在服务器端进行身份验证时,我如何防止这种情况和/或是否有任何变通方法将用户名传递给服务器?

最佳答案

一个好的方法是将登录详细信息也提交到服务器,在您的情况下是在步骤 #2 中,然后在那里再进行一次身份验证。我想您将在您的服务器上使用 php,所以请查看以下页面,我相信这是您需要的: https://developers.google.com/+/web/signin/client-to-server-flow

发送 token 后,您需要进行验证:

https://developers.google.com/+/web/signin/token-verification

这里有更多细节:

https://github.com/googleplus/gplus-verifytoken-php

关于php - 在服务器端从 Android 验证用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20811797/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com