YJSoft / gtap

Automatically exported from code.google.com/p/gtap
0 stars 0 forks source link

OAuth支持 #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
昨晚ep给代码加上了oauth支持,不过现在的身份验证方式比较�
��琐,作者可以考虑改
进一下。

现在的用法是这样的:
1. 注册OAuth,把OAuth的callback url设置为https://xxx.appspot.com/oauth
/twitter/callback
2. 把OAuth的key和secret填入oauth.py
3. 改好app.yaml之后上传到GAE
4. 
访问https://xxx.appspot.com/oauth/twitter/login注册,完成后会显示一�
��key
5. 
设置客户端的api地址为https://xxx.appspot.com/gtap_oauth/,用户名随
意,密
码为(4)显示的key即可登录

我测试过获取/发推/删除推都没问题,不过不确定还有没有其
它bug,请慎用。

(oauth.py原始作者为tav 
(http://github.com/tav/tweetapp/),我作了部分修改)

Original issue reported on code.google.com by SAPika...@gmail.com on 20 Apr 2010 at 3:32

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
修复bug
1. 部分客户端验证出错
2. 包含~字符的推无法发送

Original comment by SAPika...@gmail.com on 20 Apr 2010 at 9:54

GoogleCodeExporter commented 8 years ago
真是不好意思,现在才看到……

Oauth的支持是我一直想加进去的功能,你的代码我大概看了。
与我想的Oauth功能多少有些出入。

你的代码有些地方比我的要简洁许多,不介意我合并到下一��
�版本中吧?

刚刚已经通过Greader订阅了issues,以后不会延迟这么久了……

Original comment by rui7905 on 6 May 2010 at 12:35

GoogleCodeExporter commented 8 years ago
没事,呵呵。

我的代码可以随便修改和使用。其实现在客户端验证还有改��
�的空间,只是我懒得弄了。。。

Original comment by SAPika...@gmail.com on 6 May 2010 at 1:01

GoogleCodeExporter commented 8 years ago
期待支持OAuth,这样就能直接使用twitter bird了

Original comment by ren0...@gmail.com on 14 May 2010 at 1:49

GoogleCodeExporter commented 8 years ago
期待SAPikachu rui7905继续努力,俺是菜鸟,期待好结果

Original comment by ningye2...@gmail.com on 15 May 2010 at 4:25

GoogleCodeExporter commented 8 years ago
最近发现有的客户端会先到官方验证密码再用自定义api操作��
�如果api密码和官网密码不一样就
不能用。。。于是修改了一下,现在在api注册后可以修改密��
�了。顺便修复了之前的一个bug。

Original comment by SAPika...@gmail.com on 16 May 2010 at 1:54

GoogleCodeExporter commented 8 years ago
呵呵,真快,又更新了

Original comment by ningye2...@gmail.com on 16 May 2010 at 3:14

GoogleCodeExporter commented 8 years ago
好像没办法发推,收正常twitter bird

Original comment by mallocf...@gmail.com on 16 May 2010 at 9:45

GoogleCodeExporter commented 8 years ago
呃。。。echofon和pocketwit测试正常,是发什么内容都会出错么�
��

Original comment by SAPika...@gmail.com on 16 May 2010 at 9:52

GoogleCodeExporter commented 8 years ago
能发了 哈哈,要用https

Original comment by mallocf...@gmail.com on 16 May 2010 at 9:58

GoogleCodeExporter commented 8 years ago
是否能加一个超过140字符,自动截断的功能呢?

Original comment by jacksong...@gmail.com on 16 May 2010 at 10:03

GoogleCodeExporter commented 8 years ago
GTAP能加上gizp压缩吗?gae是支持gzip的.

Original comment by tianchao...@gmail.com on 16 May 2010 at 10:08

GoogleCodeExporter commented 8 years ago
呃。。。这些要等原作者来回复了

Original comment by SAPika...@gmail.com on 16 May 2010 at 12:35

GoogleCodeExporter commented 8 years ago
上来汇报,Gravity正常使用,twitter api 选项中记得填入:
https://xxx.appspot.com/gtap_oauth/,必须填入“https:”,这个Gravity��
�认以前是不用填
http://之类的,这个特殊,感谢 rui7905和 SAPikachu

Original comment by ningye2...@gmail.com on 16 May 2010 at 2:28

GoogleCodeExporter commented 8 years ago
gzip的问题,这个请参看 issues 4

超过140个字符自动截断,这个貌似不应该是一个api 
proxy的功能吧,理论上是客户端来做这个
事情,包括URL的一些操作。

Original comment by rui7905 on 17 May 2010 at 1:43

GoogleCodeExporter commented 8 years ago
中文评论看着舒服多了。

Original comment by jimmy2...@gmail.com on 17 May 2010 at 8:37

GoogleCodeExporter commented 8 years ago
Gravity使用,我的七个列表有两个无法更新,错误代码404,说�
��“未找到”!未更新的列表名无
规律性。求解!

Original comment by minso...@gmail.com on 18 May 2010 at 3:09

GoogleCodeExporter commented 8 years ago
列表名字有没有什么特殊字符或者标点符号。。。?

Original comment by SAPika...@gmail.com on 18 May 2010 at 3:39

GoogleCodeExporter commented 8 years ago
Comment 3 by SAPikachu, Apr 20, 2010
修复bug
1. 部分客户端验证出错
2. 包含~字符的推无法发送
    gtap-oauth.7z 
26.5 KB   Download
===================
这个oauth.py里面加了security,SDUpload不能上传啊~

Original comment by logi...@gmail.com on 18 May 2010 at 5:43

GoogleCodeExporter commented 8 years ago
不太明白,加了什么security?

Original comment by SAPika...@gmail.com on 18 May 2010 at 6:06

GoogleCodeExporter commented 8 years ago
<pre>
Error parsing yaml file:
Unexpected attribute 'secure' for object of type <class 'google.appengine.api.ap
pinfo.URLMap'>.
  in "gtap-0.3.3\app.yaml", line 10, column 11
</pre>

就是不能识别  secure: always  这句

Original comment by logi...@gmail.com on 18 May 2010 at 6:20

GoogleCodeExporter commented 8 years ago
呃。。。SDUpload不支持么,那删掉secure那行也可以,不过这样
就没有强制https了

Original comment by SAPika...@gmail.com on 18 May 2010 at 6:34

GoogleCodeExporter commented 8 years ago
的确,sdupload太老了,还是用的1.0.0的SDK,官方出到1.3.3了

话说gtap-0.3.3和gtap-oauth配合不好啊,callback函数有问题
gtap-0.3.1貌似没问题

另外求解0.3.3和0.3.1的不同

Original comment by logi...@gmail.com on 18 May 2010 at 6:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
列表名字有没有什么特殊字符或者标点符号。。。?
——
没有!全是因为英文字母,其中一个是media,gravity里列表名��
�,就是不能更新它!

Original comment by minso...@gmail.com on 18 May 2010 at 6:40

GoogleCodeExporter commented 8 years ago
于是用了oauth版就不需要原版了吧。。。功能基本都是重复的
。。。

Original comment by SAPika...@gmail.com on 18 May 2010 at 6:42

GoogleCodeExporter commented 8 years ago
Comment 28  by minson72, Today (2 minutes ago)

列表名字有没有什么特殊字符或者标点符号。。。?
——
没有!全是因为英文字母,其中一个是media,gravity里列表名��
�,就是不能更新它!

可以贴一下错误之后gae的log么?

Original comment by SAPika...@gmail.com on 18 May 2010 at 6:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
列表名字有没有什么特殊字符或者标点符号。。。?
——
没有!全是因为英文字母,其中一个是media,gravity里列表名��
�,就是不能更新它!

可以贴一下错误之后gae的log么?

重新验证了一遍,重新添加账号后,更新可以了!
可能是验证时账号发生错误了?

Original comment by minso...@gmail.com on 18 May 2010 at 7:06

GoogleCodeExporter commented 8 years ago
很有可能。。。list没研究过,可能是和名字有关

Original comment by SAPika...@gmail.com on 18 May 2010 at 7:21

GoogleCodeExporter commented 8 years ago
于是用了oauth版就不需要原版了吧。。。功能基本都是重复的
。。。
===
可是oauth版没有0.3.3新啊,我还期待0.3.3加个什么自动截断功��
�~

Original comment by logi...@gmail.com on 18 May 2010 at 2:01

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Gravity怎么设置,好像个Key太长,Gravity的Twitter帐号不能完全��
�入那个Key

Original comment by Ericpoon...@gmail.com on 18 May 2010 at 5:39

GoogleCodeExporter commented 8 years ago
comment 8的版本在验证帐号之后下面就可以改key了

我刚才看过0.3.3,其实只是添加了一些log代码,没什么实际改
动。。。

Original comment by SAPika...@gmail.com on 19 May 2010 at 1:06

GoogleCodeExporter commented 8 years ago
用mixero虽然能够登录,能够接收twt,但是还是发送就会报错��
�……即使加了https也是一样

Original comment by whos...@gmail.com on 19 May 2010 at 9:57

GoogleCodeExporter commented 8 years ago
于是还是得看看gae log。。。

Original comment by SAPika...@gmail.com on 19 May 2010 at 10:03

GoogleCodeExporter commented 8 years ago
四,oauth验证
①访问http://xxx.appspot.com/oauth/twitter/login 
注册,完成后会显示一个key,你可以修
改这个key为自己api的密码(注意这里http没有s)
在这一步出现下面这些提示是什么 意思?
Traceback (most recent call last):
File 
“/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init
__.py
”, line 511, in __call__
handler.get(*groups)
File “/base/data/home/apps/appid/1.342051373385725574/oauth.py”, line 408, 
in get
self.response.out.write(getattr(client, action)())
File “/base/data/home/apps/appid/1.342051373385725574/oauth.py”, line 288, 
in 
callback
db.delete(old)
File 
“/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.p
y”, 
line 1300, in delete
keys = [_coerce_to_key(v) for v in models]
File 
“/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.p
y”, 
line 362, in _coerce_to_key
value = value[0]
IndexError: list index out of range

An application would like to connect to your account
The application XXXX by would like the ability to access and update your data 
on 
Twitter. Sign out if you want to connect to an account other than XXXX.
Allow XXXX access?
我点了ALLOW以后就出现那段代码了,并且自动的在HTTP后面加��
�S。。。

Original comment by kusoyab...@gmail.com on 19 May 2010 at 11:29

GoogleCodeExporter commented 8 years ago
请教一下,(4)完成后显示的那个key是不是浏览器地址栏中�
��https://xxx.appspot.com
/?oauth_token=”后面的长长的那一串字符?

Original comment by smshess on 19 May 2010 at 12:44

GoogleCodeExporter commented 8 years ago
Comment 42  by kusoyabali

呃。。。你用的是那个版本?我记得这个bug在comment 
8的版本应该是修复了。。。

Original comment by SAPika...@gmail.com on 19 May 2010 at 1:25

GoogleCodeExporter commented 8 years ago
Comment 43  by smshess

不是的,key是注册完在页面显示那个,id-XXXXX形式的

Original comment by SAPika...@gmail.com on 19 May 2010 at 1:26

GoogleCodeExporter commented 8 years ago
我在用sdupload上传的时候老是出现图中的问题,麻烦问下如何
解决?

Original comment by dani...@gmail.com on 19 May 2010 at 2:21

Attachments:

GoogleCodeExporter commented 8 years ago
建议用官方sdk上传,sdupload貌似很旧了

Original comment by SAPika...@gmail.com on 20 May 2010 at 12:50

GoogleCodeExporter commented 8 years ago
我也是出现42楼那样的情况,有没有办法解决呢?

Original comment by rik.le...@gmail.com on 20 May 2010 at 1:27

GoogleCodeExporter commented 8 years ago
请使用8楼版本。。。(果然前面的不删除会很混乱。。。orz

Original comment by SAPika...@gmail.com on 20 May 2010 at 1:45

GoogleCodeExporter commented 8 years ago
SAPikachu,你的邮箱就是这个名字么?

Original comment by rui7905 on 20 May 2010 at 2:31