chromium 16 chromium 登陆 google 账号

01 自己编译的 chromium 登陆google账号问题

自己编译的chromium,如果编译的时候,没有提供google key,也没有需改账号体系内容相关代码时,登陆google账号会失败。提示[抱歉,出了点问题。请重试]。如下图:
登陆google账号失败

02 申请 google key

获取密钥(ID)教程:
https://www.chromium.org/developers/how-tos/api-keys
获取密钥(ID)地址:
https://cloud.google.com/console
https://console.cloud.google.com/start

csdn blog参考:https://blog.csdn.net/yori_chen/article/details/79654294
申请 Google API
1、https://cloud.google.com/console
2、创建或选择已有项目 →→ 左侧边栏 API和服务 →→ 凭证
3、创建凭证(类型为 “API 密钥”,名称随意, 不使用密钥限制,记住生成的key)
4、再创建一个凭证(类型为 “OAuth 客户端 ID”, 名称随意, 应用类型选择 “其他”, 记住生成的 “客户端 ID” 和 “客户端密钥”)
5、格式填写自己的 API Key

setx GOOGLE_API_KEY 生成的API密钥 
setx GOOGLE_DEFAULT_CLIENT_ID 生成的客户端ID 
setx GOOGLE_DEFAULT_CLIENT_SECRET 生成的客户端密钥

申请的时候,需要一个信用卡账号。

需要信用卡账号

03 测试效果

使用 https://blog.csdn.net/yori_chen/article/details/79654294 提供的key设置后,登陆正常。

rem 停用
setx GOOGLE_API_KEY "no"
setx GOOGLE_DEFAULT_CLIENT_ID "no"
setx GOOGLE_DEFAULT_CLIENT_SECRET "no"
rem 启用,记得设置好后,需要重新开启自己编译的chromium
setx GOOGLE_API_KEY AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k
setx GOOGLE_DEFAULT_CLIENT_ID 811574891467.apps.googleusercontent.com
setx GOOGLE_DEFAULT_CLIENT_SECRET kdloedMFGdGla2P1zacGjAQh
设置 google key 登陆google账号成功

04 20210315 后,google取消上面默认登录方式

https://www.chromium.org/developers/how-tos/api-keys 最后部分说明,官网已经停止对 GOOGLE_DEFAULT_CLIENT_ID 和 GOOGLE_DEFAULT_CLIENT_SECRET 的支持。也就是说,即使申请了api key,也不能默认登录了。

这个时候,可以考虑使用直接登录的方式,而不是同步的方式登录,至少在92版本,还是可以的。

src\components\signin\public\identity_manager\consent_level.h
把这个文件的 两个值调换一下,不用修改其他代码。即可实现同步效果。估计过些日志页会不行吧。

enum class ConsentLevel {
  // No specific consent required. In particular, browser sync consent is not
  // required. Operations are allowed if the user is signed in to Chrome. It is
  // the responsibility of the client to ask for explicit user consent for any
  // operation that requires information from the primary account.
  // See "unconsented primary account" in ./README.md.
  //kSignin,

  // Chrome browser sync consent is required. Historically (before DICE and
  // Project Butter) most operations implicitly required this consent. See
  // "primary account" in ./README.md.
  kSync,
  kSignin
};

chromium 同步成功

要研究一下官网 api 的设置内容,设置正确才能生效的。
https://www.chromium.org/developers/how-tos/api-keys

参考官网操作说明

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值