如何让我的Google Apps域成为OpenID提供商.有什么文档,教程,工作示例吗?
如何使用Google Apps域身份验证在我自己的应用程序中对用户进行身份验证(我的意思是没有OpenID).我听说这是关于gdata api的东西,但我不知道从哪里开始.有任何有用的教程如何操作或工作示例?
我想知道免费或开源解决方案.
所以我很难理解一些东西
如果您对Web Apps执行Oauth,则需要使用回调URL注册您的站点并获得唯一的消费者密钥。但是,一旦获得了针对Web Apps的Oauth令牌,就无需从注册域中生成对Google服务器的Oauth调用。我经常使用笔记本电脑上本地主机上通过apache服务器运行的脚本中的密钥和令牌,而Google从不说“您不是从注册域发送此请求”。它只是向我发送数据。
现在,据我了解,如果您对已安装的应用程序执行Oauth,则将使用“匿名”而不是从Google获得的密钥。
我一直在考虑仅使用OAuth for Web Apps auth方法,然后将该令牌传递给已安装的应用程序,该应用程序将我的秘密代码嵌入其内部。令人担心的是,恶意人员可能会发现该代码。但是,有什么更安全的方法呢……使它们适用于秘密代码或让它们默认为匿名?
如果当替代方案使用“匿名”作为秘密时发现“秘密”,那么真正的坏处是什么呢?
我正在写一个网络应用程序来自动搜索谷歌的嗡嗡声.
我写了一个C#库来管理"Oauth dance"并且它工作正常,我可以得到oauth_token和oauth_token_secret.
我使用www.googlecodesamples.com/oauth_playground/来验证我的oauth_token和oauth_token_secret,它运行正常.我使用GET和https://www.googleapis.com/buzz/v1/activities/@me/@self 对其进行测试以获取用户的流,它可以正常工作.
但现在
我正在尝试使用我的C#库做同样的事情,但我总是得到这个错误:
<?xml version="1.0" encoding="UTF-8"?>
<errors xmlns="http://schemas.google.com/g/2005">
<error>
<domain>GData</domain>
<code>invalid</code>
<location type="header">Authorization</location>
<internalReason>Unknown authorization header</internalReason>
</error>
</errors>
Run Code Online (Sandbox Code Playgroud)
我的请求标题与操场上的标题相同.
Accept: */*
Content-Type: application/atom+xml
Authorization: OAuth oauth_version="1.0", oauth_nonce="9216320",
oauth_timestamp="1283430867", oauth_consumer_key="www.mysite.com",
oauth_token="1%2FZodlNmPP96GT11vYaWA0y6QoqKLqNqZ8bNmxknZZZc",
oauth_signature_method="HMAC-SHA1",
oauth_signature="Tuu82feKNWa4CxoDUyvtIEVODRA%3D"
GData-Version: 2.0
Run Code Online (Sandbox Code Playgroud)
这是C#代码:
string headAuth = "Authorization: OAuth oauth_version=\"1.0\", oauth_nonce=\"9216320\", oauth_timestamp=\"1283430867\",
oauth_consumer_key=\"www.mysite.com\", oauth_token=
\"1%2FZodlNmPP96GT11vYaWA0y6QoqKLqNqZ8bNmxknZZZc\",
oauth_signature_method=\"HMAC-SHA1\", oauth_signature=
\"Tuu82feKNWa4CxoDUyvtIEVODRA%3D\"";
HttpWebRequest req1 =(HttpWebRequest)HttpWebRequest.Create("https://www.googleapis.com/buzz/v1/activities/@me/@self");
req1.Method = "GET";
req1.Accept = "*/*";
req1.ContentType = "application/atom+xml";
req1.Headers.Add("Authorization", headAuth);
req1.Headers.Add("GData-Version", "2.0");
try
{
HttpWebResponse response1 =(HttpWebResponse)req1.GetResponse();
using (var sr = new …Run Code Online (Sandbox Code Playgroud) 我已成功使用OAuth1.0 + OpenID混合协议与Google进行身份验证,然后使用其服务.
但是,我面临特定用户帐户的错误.我目前的流程:
执行发现
重定向用户与OpenID和OAuth的参数提供者(如:https://accounts.google.com/o/openid2/auth?https://accounts.google.com/o/openid2/auth?openid.ns=http://specs.openid.net/auth/2.0&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&.....&openid.ns.ext2=http://specs.openid.net/extensions/oauth/1.0&openid.ext2.consumer=mywebsite.com&openid.ext2.scope=https://picasaweb.google.com/data+https://www-opensocial.googleusercontent.com/api/people/+http://www.google.com/m8/feeds/)
一旦用户成功验证并批准了权限请求,应用程序就会返回到我指定的callbackurl long,其字符串类似于上述请求,我从"openid.ext2.request_token"中提取授权令牌,然后通过传递获取访问令牌.
但是对于特定用户帐户,在成功进行身份验证和授予权限后,不是按照上述方式传递结果,而是重定向到某个URL https://accounts.google.com/o/openid2/approval?xsrfsign=AC9jObYAAAAATpF6x6S6Ac7MfHaZ,然后返回到我的应用程序,而不在查询字符串中包含任何参数.
相同的代码适用于其他帐户.我无法确定一个帐户的特殊功能(除了我上个月创建的).请注意,只有当我在范围内包含picasa时才会发生这种情况.如果我排除picasa,它就可以了.
请帮忙.
我正在尝试使用gdata provisioning api文档中的以下代码检索用户.我正在尝试这个django 1.3应用程序,运行gdata-2.0.16于python2.7:
from gdata.apps import client
from myapp import settings
client = client.AppsClient(domain=settings.GOOGLE_ADMIN_DOMAIN)
client.ClientLogin(email=settings.GOOGLE_ADMIN_EMAIL, password=settings.GOOGLE_ADMIN_PASSWORD, source='apps')
user_account = client.RetrieveUser('user_name')
Run Code Online (Sandbox Code Playgroud)
为了保护隐私,我将实际用户名更改为'user_name',但这是代码的一般要点.
当解释器到达上面代码中的最后一行时,我收到以下错误:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/gdata/apps/client.py", line 182, in RetrieveNickname
return self.GetEntry(uri, desired_class=gdata.apps.data.NicknameEntry)
File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 652, in get_entry
desired_class=desired_class, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 319, in request
RequestError)
RequestError: Server responded with: 403, <HTML>
<HEAD>
<TITLE>Insecure HTTP requests not permitted. …Run Code Online (Sandbox Code Playgroud) 我有一个奇怪的问题.我正在核心java中编写一个应用程序,需要在google docs上访问自己的帐户.所以经过大量的谷歌搜索,我发现OAuth2.0与服务帐户是我正在寻找的东西.但我没有使用App Engine或其他任何东西.它的应用很简单.我不知道如何使用OAuth.我写了下面的代码,我不知道如何进一步.正在找人指导我:
GoogleCredential credential = new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT).setJsonFactory(JSON_FACTORY)
.setServiceAccountId(EMAIL)
.setServiceAccountScopes(SCOPE)
.setServiceAccountPrivateKeyFromP12File(new File("lib/key.p12")).build();
SpreadsheetService service = new SpreadsheetService("My test Service");
//service .setOAuthCredentials(parameters, signer);
Run Code Online (Sandbox Code Playgroud)
谢谢 !
我需要在google电子表格中添加多行(几百行).目前我正在循环中这样做:
for row in rows
_api_client.InsertRow(row, _spreadsheet_key, _worksheet_id)
Run Code Online (Sandbox Code Playgroud)
这是非常慢的,因为行是逐个添加的.
有什么方法可以加快速度吗?
所以我跟着这个,我正在尝试运行他的第一个php示例.我收到以下错误:
PHP警告:require_once(
Zend/Http/Header/HeaderValue.php):无法打开流:第45行/opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Http/Client.php中没有此类文件或目录
我检查过,文件实际上并不存在.所以我从最小的1.12下载中添加了它.它然后说不Zend/Xml/Security.php存在所以我添加它.
现在我收到以下错误:
PHP Notice: Undefined offset: 1 in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/ClientLogin.php on line 150
PHP Stack trace:
PHP 1. {main}() /opt2/sites/gdataApi/test.php:0
PHP 2. Google_Spreadsheet->__construct() /opt2/sites/gdataApi/test.php:11
PHP 3. Google_Spreadsheet->login()/opt2/sites/gdataApi/Google_Spreadsheet.php:40
PHP 4. Zend_Gdata_ClientLogin::getHttpClient() /opt2/sites/gdataApi/Google_Spreadsheet.php:223
PHP Notice: Undefined variable: php_errormsg in /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php on line 834
PHP Stack trace:
PHP 1. {main}() /opt2/sites/gdataApi/test.php:0
PHP 2. Google_Spreadsheet->addRow() /opt2/sites/gdataApi/test.php:24
PHP 3. Google_Spreadsheet->getSpreadsheetId() /opt2/sites/gdataApi/Google_Spreadsheet.php:62
PHP 4. Zend_Gdata_Spreadsheets->getSpreadsheetFeed() /opt2/sites/gdataApi/Google_Spreadsheet.php:252
PHP 5. Zend_Gdata->getFeed() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/Spreadsheets.php:150
PHP 6. Zend_Gdata_App->getFeed() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata.php:162
PHP 7. Zend_Gdata_App->importUrl() /opt2/sites/gdataApi/ZendGdata-1.12.13/library/Zend/Gdata/App.php:213
PHP …Run Code Online (Sandbox Code Playgroud) 由于Google停止了对旧版Auth的支持,现在我们必须使用oAuth 2,我们的简单桌面应用程序无法再从我的Google帐户中读取联系人.
很好 - 我理解这一点,但是这个新的oAuth 2非常复杂......我不是从开发人员的角度来谈论.从我在线阅读.我们现在必须让我们的客户跳过众多的箍,以便我们的简单应用程序读取存储在他们的Google邮件/联系人中的联系人.
我的iPhone似乎只能使用我一年前输入的典型电子邮件和密码来同步联系人.他们如何让它发挥作用?然而,通过我简单的桌面应用程序,客户端必须在谷歌开发者网站上搜索并使用API设置等.我是开发人员,我很困惑! - 你能想象我的客户会经历什么......它不能复杂化.
有没有人可以给我简单的1,2,3让C#桌面应用程序关闭并从特定的Gmail帐户获取联系人(只读)... 最少的摆弄(为Gmail帐户的所有者).
我会完成应用程序中的所有艰苦工作 - 我只是不希望客户端花费一个小时来授权和创建API并在开发人员站点中点击(他/她不是开发人员).
我已经更新了Strawberry Perl 64-bit 5.30.2001包gdata。现在,加载时library(gdata)我总是收到此警告消息,这些消息似乎与 Perl 相关。
suppressPackageStartupMessages(library(gdata))
# Warning messages:
# 1: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait, :
# running command 'C:\Windows\system32\cmd.exe /c ftype perl' had status 2
# 2: In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait, :
# running command 'C:\Windows\system32\cmd.exe /c ftype perl' had status 2
Run Code Online (Sandbox Code Playgroud)
然而,read.xls我需要的功能似乎运行良好,只是每次使用时都会重复出现警告。
read.xls("http://file-examples-com.github.io/uploads/2017/02/file_example_XLS_10.xls")
# trying URL 'http://file-examples-com.github.io/uploads/2017/02/file_example_XLS_10.xls'
# Content type 'application/vnd.ms-excel' …Run Code Online (Sandbox Code Playgroud)