Google OAuth

编程入门 行业动态 更新时间:2024-10-17 05:33:05
本文介绍了Google OAuth-保密客户端ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Google Cloud Endpoints JavaScript客户端中使用OAuth时,如何保存客户端ID的保密性?

此处详细介绍了如何在Google Cloud Endpoints JavaScript客户端中实现0Auth.一个>.在下面的代码段中,客户端ID作为参数传递给OAuth方法.

How to implement 0Auth in the Google Cloud Endpoints JavaScript client is detailed here. In the code snippet below the client ID is passed as a parameter to the OAuth method.

gapi.auth.authorize({client_id: CLIENT_ID, scope: SCOPES, immediate: mode}, callback);

由于最终用户将以纯文本形式接收脚本文件,而无论使用HTTPS如何,如何避免将客户端ID移交给您服务的每个用户?毕竟,组合JavaScript代码以找到客户端ID相当简单.

Since the end user will receive the script file in clear text, regardless of the use of HTTPS, how would you avoid handing the client ID over to every user you serve? After all, it would be rather simple to comb the JavaScript code to find the client ID.

推荐答案

您没有.任何人都可以看到并拦截它(如您所述),这是困惑的代理问题的根源.

You don't. Anyone can see and intercept it (as you stated), which is the root of the confused deputy problem.

这就是为什么验证令牌的原因.有关令牌验证和困惑的代理问题的简单说明,请在如何以及为什么执行Google OAuth令牌验证.

That's why you validate your tokens. For a simple explanation of token validation and the confused deputy problem, check out this great SO question and answer on How and why is Google OAuth token validation performed.

更多推荐

Google OAuth

本文发布于:2023-11-07 15:24:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566812.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Google   OAuth

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!