1. <small id='DeVun'></small><noframes id='DeVun'>

  2. <legend id='DeVun'><style id='DeVun'><dir id='DeVun'><q id='DeVun'></q></dir></style></legend>

    <i id='DeVun'><tr id='DeVun'><dt id='DeVun'><q id='DeVun'><span id='DeVun'><b id='DeVun'><form id='DeVun'><ins id='DeVun'></ins><ul id='DeVun'></ul><sub id='DeVun'></sub></form><legend id='DeVun'></legend><bdo id='DeVun'><pre id='DeVun'><center id='DeVun'></center></pre></bdo></b><th id='DeVun'></th></span></q></dt></tr></i><div id='DeVun'><tfoot id='DeVun'></tfoot><dl id='DeVun'><fieldset id='DeVun'></fieldset></dl></div>

      <bdo id='DeVun'></bdo><ul id='DeVun'></ul>
      <tfoot id='DeVun'></tfoot>
    1. 服务器的 Google API 身份验证

      时间:2023-10-02

          <tbody id='MXyeI'></tbody>

            <i id='MXyeI'><tr id='MXyeI'><dt id='MXyeI'><q id='MXyeI'><span id='MXyeI'><b id='MXyeI'><form id='MXyeI'><ins id='MXyeI'></ins><ul id='MXyeI'></ul><sub id='MXyeI'></sub></form><legend id='MXyeI'></legend><bdo id='MXyeI'><pre id='MXyeI'><center id='MXyeI'></center></pre></bdo></b><th id='MXyeI'></th></span></q></dt></tr></i><div id='MXyeI'><tfoot id='MXyeI'></tfoot><dl id='MXyeI'><fieldset id='MXyeI'></fieldset></dl></div>
              • <bdo id='MXyeI'></bdo><ul id='MXyeI'></ul>

                <small id='MXyeI'></small><noframes id='MXyeI'>

              • <tfoot id='MXyeI'></tfoot>
              • <legend id='MXyeI'><style id='MXyeI'><dir id='MXyeI'><q id='MXyeI'></q></dir></style></legend>
              • 本文介绍了服务器的 Google API 身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我一直在尝试让 Google 的日历 API 在 PHP 网络中运行申请,但我很难通过身份验证.

                I've been trying to get Google's Calendar API working in a PHP web application, but I'm having a hard time getting authenticated.

                我想要做的是允许用户与服务器已知的单个帐户的日历进行交互.

                What I want to do is to allow users to interact with calendars of a single account known by the server.

                OAuth 2.0 文档 中涵盖的每种类型的场景都谈论用户同意"这涉及登录表单和个人用户登录,但我希望服务器本身直接进行身份验证并为自己获取访问令牌.

                Each type of scenario covered in the OAuth 2.0 docs talks about "user consent" which involves a login form and the individual user logging in, but I want the server itself to authenticate directly and obtain an access token for itself.

                是否有 OAuth 的某些部分或我可以使用的替代机制来执行此操作?

                Is there some part of OAuth or some alternative mechanism I can use to do this?

                推荐答案

                为此,您必须完成用户同意的步骤,然后将其提供给您的访问令牌复制到 PHP 代码中.

                In order to do this, you must go through the steps for user consent and then copy the access tokens it gives you into the PHP code.

                OAuth 通常的流程是这样的:

                The usual procedure for OAuth is like this:

                1. 将用户发送到身份验证页面.
                2. 用户返回 $_GET['code']
                3. 将 $_GET['code'] 发送到 OAuth 服务器以获取令牌
                4. 在数据库中为用户存储令牌(或会话,如果它非常短暂)

                但是当使用这样的单个日历进行操作时,您需要修改步骤 4.相反,您将令牌转储到屏幕并将其作为变量复制到您的 PHP 文件中,而不是将其放入数据库中.然后,当您将访问令牌传递给服务器时,您只需传递已知的静态令牌,而不是来自数据库/会话的动态令牌.

                But when doing it with a single calendar like this, you modify step 4. Instead, you dump the token to screen and copy it into your PHP file as variables, instead of putting it in the database. Then when you go to pass the access token to the server, you just pass the known, static token rather than a dynamic token from the database / session.

                这篇关于服务器的 Google API 身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:用于 PHP 的 OAuth 2.0 服务器 下一篇:yii2、google outh2 和范围

                相关文章

                最新文章

                  <i id='Jv2If'><tr id='Jv2If'><dt id='Jv2If'><q id='Jv2If'><span id='Jv2If'><b id='Jv2If'><form id='Jv2If'><ins id='Jv2If'></ins><ul id='Jv2If'></ul><sub id='Jv2If'></sub></form><legend id='Jv2If'></legend><bdo id='Jv2If'><pre id='Jv2If'><center id='Jv2If'></center></pre></bdo></b><th id='Jv2If'></th></span></q></dt></tr></i><div id='Jv2If'><tfoot id='Jv2If'></tfoot><dl id='Jv2If'><fieldset id='Jv2If'></fieldset></dl></div>
                1. <legend id='Jv2If'><style id='Jv2If'><dir id='Jv2If'><q id='Jv2If'></q></dir></style></legend>

                  • <bdo id='Jv2If'></bdo><ul id='Jv2If'></ul>
                2. <tfoot id='Jv2If'></tfoot>

                    <small id='Jv2If'></small><noframes id='Jv2If'>