RedTea / gtap

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

OAuth支持 #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 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

Attachments:

GoogleCodeExporter commented 9 years ago
恩。对的,twitter号也是这个

Original comment by SAPika...@gmail.com on 20 May 2010 at 2:54

GoogleCodeExporter commented 9 years ago
SAPikachu,你确定46楼图中的错误是上传工具的问题?

Original comment by dani...@gmail.com on 20 May 2010 at 3:40

GoogleCodeExporter commented 9 years ago
呃。。。起码我用官方sdk上传一直都没问题。。。sdupload我没
用过,不过之前好像有人提过它
不支持GAE新增的一些特性,我感觉就是因为这个原因。

Original comment by SAPika...@gmail.com on 20 May 2010 at 4:28

GoogleCodeExporter commented 9 years ago
to Comment 46 by daniums, Today (15 hours ago)
to Comment 42 by kusoyabali, Yesterday (18 hours ago)

出现过同样问题,解决方案:
停止所有代理,修改hosts回到IPv4即可·

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

GoogleCodeExporter commented 9 years ago
42楼的问题我也出现了
待解决

Original comment by don...@gmail.com on 20 May 2010 at 12:13

GoogleCodeExporter commented 9 years ago
请问是几楼的版本。。。?另外可以贴一下stack 
trace么。。。?

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

GoogleCodeExporter commented 9 years ago
我好几个版本混搭 所以我已记不清了
抱歉
谢谢你的编写
偶然尝试某一个版本可以

Original comment by don...@gmail.com on 20 May 2010 at 1:32

GoogleCodeExporter commented 9 years ago
这问题8楼的版本应该是修复了的。。。各位如果再出现那问�
��的话试试下载那个覆盖一下吧

Original comment by SAPika...@gmail.com on 21 May 2010 at 1:04

GoogleCodeExporter commented 9 years ago
有指定用户账号才能登陆验证的功能吗?

Original comment by minso...@gmail.com on 21 May 2010 at 3:25

GoogleCodeExporter commented 9 years ago
这个暂时还没有,我有空看一下。。。

Original comment by SAPika...@gmail.com on 21 May 2010 at 3:49

GoogleCodeExporter commented 9 years ago
Traceback (most recent call last):
  File 
"/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__in
it__.py", line 511, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/cqpipashan/1.342105259360122832/oauth.py", 
line 440, in get
    self.handle(service,action)
  File "/base/data/home/apps/cqpipashan/1.342105259360122832/oauth.py", 
line 455, in handle
    self.response.out.write(getattr(client, action)())
  File "/base/data/home/apps/cqpipashan/1.342105259360122832/oauth.py", 
line 227, in login
    return self.get_request_token()
  File "/base/data/home/apps/cqpipashan/1.342105259360122832/oauth.py", 
line 243, in get_request_token
    **dict(token.split('=') for token in token_info.split('&'))
ValueError: dictionary update sequence element #0 has length 1; 2 is required

这是什么问题呢?请教!

Original comment by zengli...@gmail.com on 21 May 2010 at 11:40

GoogleCodeExporter commented 9 years ago
Oauth的api是不是只能一个人用了?

Original comment by zzq...@gmail.com on 21 May 2010 at 11:40

GoogleCodeExporter commented 9 years ago
Comment 61  by zengliang
--------------------------
这个应该是twitter抽风。。。迟点再试试。。。?

Comment 62  by zzq889
--------------------------
多人用是可以的,但是用其他人搭的api会不安全,因为需要��
�gae服务器记录一些信息。所以最
好还是自己搭来用。

Original comment by SAPika...@gmail.com on 21 May 2010 at 12:36

GoogleCodeExporter commented 9 years ago
Logicmd,我在上传的时候没有开代理,另外,工具用sdupload没��
�题吧?

Original comment by dani...@gmail.com on 21 May 2010 at 3:01

GoogleCodeExporter commented 9 years ago
谢谢logicmd,我已经成功了。

Original comment by dani...@gmail.com on 22 May 2010 at 12:40

GoogleCodeExporter commented 9 years ago
期待代码早日何并到gtap trunk中

Original comment by bill...@gmail.com on 22 May 2010 at 5:49

GoogleCodeExporter commented 9 years ago
我用xxx.appspot.com/oauth/twitter/login去认证  就返回这个。。OK, 
you've denied 
Gravity@jym access to interact with your account!  怎么看那个什么key

Original comment by jiayim...@gmail.com on 22 May 2010 at 10:26

GoogleCodeExporter commented 9 years ago
于是没有提示你选allow或者deny么。。。?还是说你点了deny。�
��。?

Original comment by SAPika...@gmail.com on 22 May 2010 at 10:51

GoogleCodeExporter commented 9 years ago
windows 下面有哪个客户端支持gtap+oauth的啊?求推荐

Original comment by supercyp...@gmail.com on 22 May 2010 at 6:45

GoogleCodeExporter commented 9 years ago
理论上只要能用gtap,oauth版也应该可以用。我用的是echofon,�
��前用过witty、twibble

Original comment by SAPika...@gmail.com on 23 May 2010 at 12:56

GoogleCodeExporter commented 9 years ago
我也遇到了和61楼相同的问题...
请教下各位有什么解决方法么?

Original comment by conanshang on 23 May 2010 at 4:53

GoogleCodeExporter commented 9 years ago
出错的各位可以描述一下操作步骤么?包括页面出现的内容��
�按了什么按钮。我刚才测试是没问
题的。。。

Original comment by SAPika...@gmail.com on 23 May 2010 at 9:00

GoogleCodeExporter commented 9 years ago
于是新版本来了。。。
修改:
* 新版本默认设置会同时验证用户名和api密码
* 
服务器存储的信息全部使用用户名和api密码加密,现在在不��
�道密码的情况下,没办法从存储
的数据中解密出用户名和access token
* api配置文件改成oauth_config.py

新增功能:
* 
低安全性模式:此模式下对于请求只验证用户名,密码会被��
�略,适用于mixero等需要到官网
验证密码的客户端。注意:如要使用此模式,请注意保密api��
�址,如果api地址和用户名同时泄
漏的话帐号就危险了。
启用方法:oauth_config.py内“'low_security': 
False,”改成“'low_security': True,”

* 用户限制:限制可使用api的用户
启用方法:修改oauth_config.py内“'allowed_users': 
[],”,在方括号内添加允许访问的用户
名,格式请参照下面一行。如方括号保持为空,代表所有用��
�均可访问

Original comment by SAPika...@gmail.com on 24 May 2010 at 5:39

Attachments:

GoogleCodeExporter commented 9 years ago
有指定用户登陆验证的功能!辛苦了!

Original comment by minso...@gmail.com on 24 May 2010 at 8:38

GoogleCodeExporter commented 9 years ago
我给加到项目首页上去了。

Original comment by rui7905 on 24 May 2010 at 9:56

GoogleCodeExporter commented 9 years ago
修复Tween无法使用的问题,如果使用其它客户端不正常的话也
可以试试这个版本,没问题就可以
不更新了。

另外目前最新版的Tween有bug,必须用包里面的app.tween.yaml代替a
pp.yaml才能通过验证。

Original comment by SAPika...@gmail.com on 24 May 2010 at 10:37

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
设置了限制用户后验证后返回的错误信息跟楼上的一样!

Original comment by minso...@gmail.com on 24 May 2010 at 12:47

GoogleCodeExporter commented 9 years ago
如何让echofon和官方那个twitter for 
android通过搭建好gtap+oauth上推?

Original comment by xiaohei....@gmail.com on 24 May 2010 at 12:54

GoogleCodeExporter commented 9 years ago
楼上bug已修复。。。

Original comment by SAPika...@gmail.com on 24 May 2010 at 12:55

Attachments:

GoogleCodeExporter commented 9 years ago
echofon可以用KNB版,指定API地址就可以
http://code.google.com/p/kenengba/downloads/list

没有android。。。这个要等高人来回答了。。。

Original comment by SAPika...@gmail.com on 24 May 2010 at 12:59

GoogleCodeExporter commented 9 years ago
echofon 
KNB是1.9.5的,用普通的API就可以。echofon1.9.6的版本能用吗?

Original comment by xiaohei....@gmail.com on 24 May 2010 at 1:04

GoogleCodeExporter commented 9 years ago
唔,到app里删掉datastore,重传一遍可以了。

Original comment by maoyix...@gmail.com on 24 May 2010 at 1:20

GoogleCodeExporter commented 9 years ago
呃。。。rev4我试过限制用户是没问题的,可能确实是要把data
store砍掉

1.9.6要修改过才能用

Original comment by SAPika...@gmail.com on 25 May 2010 at 12:38

GoogleCodeExporter commented 9 years ago
的确:上传后,去把datastore删掉后,再去验证就行了!

Original comment by minso...@gmail.com on 25 May 2010 at 4:06

GoogleCodeExporter commented 9 years ago
更新支持/1/的url

Original comment by SAPika...@gmail.com on 25 May 2010 at 8:41

Attachments:

GoogleCodeExporter commented 9 years ago
改完key之后 用用户名和key登录失败……
同样的操作 以前8楼那个可以用的

Original comment by westtea...@gmail.com on 25 May 2010 at 9:15

GoogleCodeExporter commented 9 years ago
之前忘记说了。。。因为加密的关系,现在用户名也是大小��
�敏感的,登录的时候要注意。。。

Original comment by SAPika...@gmail.com on 25 May 2010 at 9:26

GoogleCodeExporter commented 9 years ago
ver2和ver5都试了,可以成功刷新和浏览新推,但是不能发推,
我是android手机,试了两个客户
端软件都不行。没有什么特殊奇怪的字符。

Original comment by atfa.k...@gmail.com on 25 May 2010 at 3:40

GoogleCodeExporter commented 9 years ago
又测试了一个客户端,仍然只能浏览不能发推。
现在位置android系统上三个比较流行的twitter客户端twidroid、sees
mic、andscape均已测试,
全部不能发推。
我确认我的oauth设置中Access Level设置为read and write,没问题。
谢谢。

Original comment by atfa.k...@gmail.com on 25 May 2010 at 3:53

GoogleCodeExporter commented 9 years ago
我用dabr的yegle的branch出现这样,An error occured while calling the 
Twitter API

403: Client must provide a 'status' parameter with a value.。也是没法发推
而使用twhirl【windows】可以用。

Original comment by untild...@gmail.com on 25 May 2010 at 4:06

GoogleCodeExporter commented 9 years ago
Chrome的插件Chrowety一直显示登录失败。 
别的插件上倒是可以用。

Original comment by westtea...@gmail.com on 25 May 2010 at 4:43

GoogleCodeExporter commented 9 years ago
重装一下插件之后好了…… 费解- -

Original comment by westtea...@gmail.com on 25 May 2010 at 4:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
用户名比较恢复为大小写不敏感

Original comment by SAPika...@gmail.com on 26 May 2010 at 3:55

Attachments:

GoogleCodeExporter commented 9 years ago
楼上发不了推的几位可以上传这个版本然后把错误的gae 
request log给我看看么?发我邮箱或者
贴在这里都可以,注意敏感信息要打码。
-------------------------------------
之前传错了。。。orz

Original comment by SAPika...@gmail.com on 26 May 2010 at 3:57

Attachments:

GoogleCodeExporter commented 9 years ago
这是刷新时候的log:
112.193.147.155 - - [25/May/2010:21:26:32 -0700] "GET
/gtap_oauth/statuses/home_timeline.json?since_id=14740693084&count=50 HTTP/1.1" 
200
8144 - "Seesmic,gzip(gfe)"

这是锐推时候的log:
112.193.147.155 - - [25/May/2010:21:26:51 -0700] "POST
/gtap_oauth/statuses/retweet/14741318240.json HTTP/1.1" 401 856 - 
"Seesmic,gzip(gfe)"

貌似没有需要打码的敏感信息。

Original comment by atfa.k...@gmail.com on 26 May 2010 at 4:30

GoogleCodeExporter commented 9 years ago
和61的朋友遇到的问题一样,用的OAuth的源码是最新的gtap-oauth
-rev5-debug.7z 请问该如何解决啊?
OTZ 

Original comment by trigoldwong on 26 May 2010 at 5:00

GoogleCodeExporter commented 9 years ago
# example: 'allowed_users': ['SAPikachu', 'other_user", ]

例子里'other_user后面到底是双引号还是单引号啊?这个有影响
吗??

Original comment by trigoldwong on 26 May 2010 at 5:13

GoogleCodeExporter commented 9 years ago
发现42楼,61楼都有这个问题。。。。期待楼主的解决方案!

Original comment by trigoldwong on 26 May 2010 at 5:19