gpt4 book ai didi

java - 保护 Google Cloud Endpoints 免受未经授权用户的侵害

转载 作者:行者123 更新时间:2023-12-02 08:57:20 25 4
gpt4 key购买 nike

我成功实现了auth功能described by google使用 clientid。

因此,当访问 html 页面时,系统会要求用户使用 Google 帐户进行身份验证。

问题:现在,每个人都可以使用该网站,只要他/她有 Google 帐户进行身份验证。如何限制特定用户组的使用?我是否需要管理 User 提供的唯一用户 ID 列表目的?或者是否已经有一些预构建的东西可供我使用?

最佳答案

我认为最安全的方法是保留一个 Id 列表。您希望 Google 或其他任何人知道您希望允许哪些类型的用户的依据是什么?

即使它只是地理上的,有时人们可能会使用代理或从远程位置使用您的网站。

您链接到的网站也说了很多:

在 API 后端指定授权客户端

You must specify which clients are allowed to access the API backend by means of a whitelist of client IDs. A client ID is generated by the Google API console from a client secret, such as the SHA1 fingerprint of a key used to secure an Android app, or from the Bundle ID/Apple Store ID pair for an iOS app, as described in Creating OAuth 2.0 Client IDs. At runtime, a client app is granted the authorization token it needs to send requests to the API backend if its client secret matches one contained in a client ID within the API backend's client ID whitelist.

此外,它唯一常见的身份验证(他是谁)、授权(他们可以在您的网站上做什么)来自您。

关于java - 保护 Google Cloud Endpoints 免受未经授权用户的侵害,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16754042/

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