google Apps脚本webapp的google OAuth登录名 [英] google OAuth login for google Apps Script webapps

查看:82
本文介绍了google Apps脚本webapp的google OAuth登录名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个google appscript webapp,我想使用google id选项添加登录名. 网络是基于appscript的. html部分也位于appscript上. 经过谷歌oauth的指南页上的说明后,我完全感到困惑. google OAuth仅用于获取用户详细信息,即电子邮件ID,姓名等

i have developed a google appscript webapp to which i want to add a login using google id option. the web is based on appscript. the html portion is also on appscript. After going through the instruction on the guide page of google oauth i am completely confused. google OAuth is needed only for getting the users details i.e. email id , name etc

推荐答案

根据您的最新评论,我看到您遇到了错误« Error:redirect_uri_mismatch请求中的JavaScript来源, console.developers.google .com/apis/credentials/oauthclient/…更新授权的JavaScript来源».出现此错误的原因是,您使用的是未经当前OAuth凭据授权的 URI .您可以按照以下步骤轻松解决该错误.

Based on your last comment, I see that you got the error «Error: redirect_uri_mismatch The JavaScript origin in the request, n-tk3g6s4u5jztr6tiwt4qn2j5ze3taoymlgdpaci-0lu-script.googleuser…, does not match the ones authorized for the OAuth client. Visit console.developers.google.com/apis/credentials/oauthclient/… to update the authorized JavaScript origins». This error appears because you are using a URI not authorized by your current OAuth credentials. You can easily solve that error with the following steps.

  1. 打开一个新的浏览器标签,然后在您的API上转到凭据.服务菜单.
  2. 在顶部栏中选择您的项目.
  3. OAuth 2.0客户端ID 菜单上,您将找到授权的URI.如果单击每个名称,您将看到其关联的URI.您的URI应该与它们中的任何一个都匹配,这样您的网络应用才能正常工作.单击 OAuth 2.0客户端ID 下的任何凭据的名称以继续.
  4. URIs 下修改URI(或单击+Add URI添加另一个).
  5. 单击Save.
  1. Open a new browser tab and go to Credentials on your APIs & Services menu.
  2. Select your project on the top bar.
  3. On the OAuth 2.0 Client IDs menu you will find your authorized URIs. If you click on each name, you will see its associated URI. Your URI should match any of them for your web-app to work. Click on the name of any credential under OAuth 2.0 Client IDs to continue.
  4. Modify the URI under URIs (or add a different one clicking +Add URI).
  5. Click on Save.

现在,您的URI将被授权,因此,您将不会遇到相同的错误.此配置将在几分钟内生效,但有时可能会持续更长的时间.如有其他疑问,请随时给我回信.

Now your URI will be authorised and, as a result, you won't encounter the same error. This configuration will be effective in some minutes, but sometimes it could last longer. Don't hesitate to write me back with any additional question.

这篇关于google Apps脚本webapp的google OAuth登录名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆