谷歌身份验证怎么登录_使用Google登录身份验证用户

2023-11-04

谷歌身份验证怎么登录

I hate dealing with user authentication, so I’m very happy to make user management and authentication somebody else’s problem. “Somebody else” like Google. Handling user information securely, supporting various kinds of multi-factor authentication, enabling account recovery while avoiding account hijacking… those are all much better handled by Google than by me!

我讨厌处理用户身份验证,因此很高兴让用户管理和身份验证成为其他人的问题。 像Google这样的“其他人”。 安全地处理用户信息,支持各种多因素身份验证,在进行帐户恢复的同时避免帐户被劫持……Google所处理的一切都比我好得多!

Unfortunately for me, I found it pretty confusing to get Google to do that for me. Oh, there’s accurate and detailed information about how to do it on Google’s sites. A lot of information. About a lot of different ways to do it. Mostly using libraries that, for me at least, make it hard to debug things that I do wrong. So I decided to get down to basics and work through the fundamental steps, in detail, needed to have my server-side web apps use Google Sign-in. This blog post shows how I did it, and how you can do it if you want.

对我来说不幸的是,让Google为我做这件事让我感到非常困惑。 哦,在Google网站上有关于如何执行此操作的准确而详细的信息。 很多信息。 大约有许多不同的方法可以做到这一点。 大多数情况下,至少对于我来说,使用库会使调试我做错的事情变得困难。 因此,我决定深入基础知识,并详细地进行一些基本步骤,以使我的服务器端网络应用程序使用Google登录。 这篇博客文章显示了我是如何做到的,以及如果需要的话如何实现。

逻辑步骤 (Logical Steps)

I’m comfortable managing sessions for my app, so my real problem was verifying a user’s identity before I create such a session. The steps for that are:

我很愿意为我的应用程序管理会话,所以我的真正问题是在创建此类会话之前先验证用户的身份。 具体步骤如下:

  1. The browser sends request to my app. My server checks whether there is a current active session, as indicated by a cookie it set and trusts. If there is, it’s okay, and my app returns the requested page. Otherwise, my app returns a web page stating that the user needs to authenticate to use the site further. The page has a link the user should click to do that. (Alternatively, my app could just send a redirect response to that link, but that’s pretty abrupt and might be confusing to the user.)

    浏览器将请求发送到我的应用。 我的服务器检查是否存在当前活动的会话,如它设置并信任的cookie所示。 如果有,那没关系,我的应用程序返回请求的页面。 否则,我的应用程序将返回一个网页,指出用户需要进行身份验证才能进一步使用该网站。 该页面具有用户应该单击以执行此操作的链接。 (或者,我的应用程序可以向该链接发送重定向响应,但这很突然,可能会使用户感到困惑。)

  2. The user clicks the link, and the browser sends a page request to Google. That link is to a Google page at accounts.google.com. The exact format of that link is described a bit later in this post. Google will return web pages and handle responses as needed to authenticate the user. If the authentication succeeds, Google will return a redirect response pointing to a page at my site.

    用户单击链接,浏览器将页面请求发送给Google。 该链接在accounts.google.com谷歌的网页。 该链接的确切格式将在本文后面部分进行介绍。 Google将返回网页并根据需要处理响应以验证用户身份。 如果身份验证成功,Google将返回指向我站点页面的重定向响应

  3. The user’s browser processes the redirect by sending a request to my app. My server uses information in that redirect URL to retrieve the user’s information from Google. This retrieval is from my web server to Google, not from the user’s browser. If everything goes right my server now knows who the user is, so the server creates a session and returns a response to the user that includes a header to set a cookie for that session. That response might be a web page, or a redirect back to the page the user originally requested. But now the user’s browser has a valid session cookie and the user can access my site.

    用户的浏览器通过向我的应用发送请求来处理重定向。 我的服务器使用该重定向URL中的信息来从Google检索用户的信息。 此检索是从我的Web服务器到Google,而不是从用户的浏览器。 如果一切正常,我的服务器现在知道用户是谁,因此服务器创建一个会话并向用户返回响应 ,该响应包括用于为该会话设置cookie的标头。 该响应可能是网页,或者是重定向回用户最初请求的页面。 但是现在用户的浏览器具有有效的会话cookie,并且用户可以访问我的网站。

Of those

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

谷歌身份验证怎么登录_使用Google登录身份验证用户 的相关文章

随机推荐

  • 面向对象基础案例(2)

    个人简介 作者简介 大家好 我是W chuanqi 一个编程爱好者 个人主页 W chaunqi 支持我 点赞 收藏 留言 愿你我共勉 没有什么比勇气更温文尔雅 没有什么比怯懦更冷酷无情 文章目录 面型对象基础案例 2 1 打印水果类价格
  • shell中怎么比较两个字符串的大小?

    shell中 有两个字符串 2004 05 23 和 2005 03 01 怎么来比较他们的大小呢 方法一 date d echo 2005 03 01 tr s date d echo 2004 05 23 tr s 执行结果分别为 11
  • 离线OCR中英文图片识别

    webOcr WebOcr 基于Google Tessract4机器学习构建中英文离线Ocr项目 在其基础上提供了http调用的接口 便于你在其他的项目中调用 并且提供了Docker 便于部署 特性 中文识别 快速高识别率 模型训练 通过j
  • Git 讲解及常用的操作

    这个博主的Git常用操作 以及Git的讲解 让我这个初学者收获良多 因此转载记录 https blog csdn net pzm1993 article details 79980258 前言 目前来说 版本控制主要分为 集中式版本控制 C
  • matlab中散点图的线性拟合_matlab画散点图并拟合函数曲线MATLAB画散点图和二次函数...

    matlab画散点图并拟合函数曲线 MATLAB画散点图和二次函数 www zhiqu org 时间 2020 12 07 画法如下 在输入栏分别输入x y matlab的开始菜单start gt toolboxes gt cirve fi
  • jacob 插入水印方法整理

    Dispatch activeWindow this word getProperty ActiveWindow toDispatch 取得活动窗格对象 Dispatch activePan Dispatch get activeWindo
  • 1262、可被三整除的最大和(扩展、可被k整除的最大和)

    LeetCode 1262 可被三整除的最大和 给你一个整数数组 nums 请你找出并返回能被三整除的元素最大和 示例 1 输入 nums 3 6 5 1 8 输出 18 解释 选出数字 3 6 1 和 8 它们的和是 18 可被 3 整除
  • mybatis-plus注解实现数据的批量操作

    1 批量删除 Delete Integer deletePrinterBindAll String pri
  • vue怎么在style中使用data中定义的变量

    需求 动态修改三方组件的样式 思路 项目开发中使用的某某某三方ui组件 所以想要修改这个组件的样式只能通过css进行修改 那么想要动态修改 就要在style中使用data里的变量 实现
  • python伪造请求头x-forwarded-for的作用_python3-requests伪造x-forwarded-for以及解决

    通常 我们的服务器会有一级或者多级的反向代理 因此我们代码中拿remote addr会取到最后一级反向代理的ip 为了拿到真实ip 常常会去x Forward For中拿用户最后一级代理Ip 但是由于该值是header中的 直接去取可能取到
  • Flink 窗口

    介绍 流式计算是一种被设计用于处理无限数据集的数据处理引擎 而无限数据集是指一种不断增长的本质上无限的数据集 而 window 是一种切割无限数据为有限块进行处理的手段 其分为两种类型 1 时间窗口 2 计数窗口 一 时间窗口 时间窗口根据
  • 使用ul li 实现图片的左右滚动

    最近项目中使用到了一个效果 即图片的左右滚动效果 以前也写过 但是没有整理 这次顺手整理一下吧 实现的思路很简单 图片列表使用li 实现 在ul 的最外层包裹上div 将这个div的overflow设置为隐藏 并且将ul的宽度设置到最够大
  • SQL注入—搜索注入

    SQL注入 搜索注入 本文仅供学习或参考 实验准备 皮卡丘靶场 SQL Injection 搜索型注入 实验步骤 输入任意字母 以 k 为例 进行模糊查询 查看结果 猜想数据库查询语句 select from table where use
  • Springboot整合 Minio

    Springboot整合 Minio 1 添加依赖
  • VMware Workstation虚拟机无桥接模式以及主机为无线的桥接配置

    目录 一 虚拟机网络设置无桥接模式 二 vmware 11版本 打开vm14 不兼容问题解决 三 主机为无线网络时虚拟机如何配置桥接上网 一 虚拟机网络设置无桥接模式 1 执行WIN R 输入services msc 打开服务管理器 回车
  • 快速解决Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!

    问题 Emulator emulator ERROR x86 emulation currently requires hardware acceleration 翻译 Emulator Emulator 错误 x86仿真模拟器当前需要硬件
  • 前端页面的居中问题

    垂直居中 1 设置子块元素的line height的高度为父元素的高度就可以 2 如果子元素为行内元素 可以将子元素display设置为block 水平居中 直接设置 text align center 决定行内元素 实现文字的水平居中 设
  • redis服务器命令方法详解

    redis服务器命令方法详解 指令 BGREWRITEAOF rewrite BGSAVE bgsave FLUSHALL SAVE Sync Slaveof PSYNC redis 2 8 版本 DBSIZE 指令 BGREWRITEAO
  • OpenAI 开发系列(四):掌握OpenAI API调用方法

    全文共4000余字 预计阅读时间约17 30分钟 满满干货 附代码 建议收藏 本文目标 明确获取OpenAI API密钥的流程 理解如何调用OpenAI的各类大模型 并了解其对应的相关参数 代码下载点这里 一 获取OpenAI的API ke
  • 谷歌身份验证怎么登录_使用Google登录身份验证用户

    谷歌身份验证怎么登录 I hate dealing with user authentication so I m very happy to make user management and authentication somebody