如何使用Google OAuth2 认证在本地进行调试

282 views
Skip to first unread message

Victor Gu

unread,
Apr 16, 2013, 1:52:51 AM4/16/13
to cdlug_c...@googlegroups.com
我正在写一个服务器脚本能够把学校教务处的课程表导入到Google Calendar,但是Google Calendar V3 API必须要通过OAuth2,即用户登录Google 的登录页面返回一个token给我的脚本。这里的返回页面Google要求必须是一个互联网上的页面,但是在本地测试时IP是变动的,如何进行本地调试呢?

--
Tsing Gu

顾锋

unread,
Apr 16, 2013, 9:40:57 PM4/16/13
to cdlug_c...@googlegroups.com
用域名不就好了?

2013/4/16 Victor Gu <mcvec...@gmail.com>
我正在写一个服务器脚本能够把学校教务处的课程表导入到Google Calendar,但是Google Calendar V3 API必须要通过OAuth2,即用户登录Google 的登录页面返回一个token给我的脚本。这里的返回页面Google要求必须是一个互联网上的页面,但是在本地测试时IP是变动的,如何进行本地调试呢?

--
Tsing Gu

--
You received this message because you are subscribed to the Google Groups "Chengdu GNU/Linux User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdlug_communi...@googlegroups.com.
To post to this group, send email to cdlug_c...@googlegroups.com.
Visit this group at http://groups.google.com/group/cdlug_community?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
顺祝 平安

-----------------------------------------------------------------------------------------
顾 锋 -- Gu Feng
网址:http://www.gufeng.net/
手机: +86-018980880032
-----------------------------------------------------------------------------------------
Network makes life better!

B.Tag

unread,
Apr 16, 2013, 9:47:37 PM4/16/13
to cdlug_c...@googlegroups.com
最笨的方法就是  写个脚本每天定时获取IP 然后写入你程序配置文件中,然后继续及执行 楼上以上功能,这样不就解决了么。如果机器要关的话 设置开机启动执行xx脚本就行了。
----------
个人

http://www.boolsir.com

GMAIL : bb....@gmail.com
 
Q  Q : 289871025


Victor Gu

unread,
Apr 18, 2013, 8:27:44 AM4/18/13
to cdlug_c...@googlegroups.com
谷歌大坑,还不能直接用IP,必须有个域名才可以。

B.Tag

unread,
Apr 18, 2013, 9:18:02 PM4/18/13
to cdlug_c...@googlegroups.com
如果是本地 直接伪造一个就是了。

Victor Gu

unread,
Apr 19, 2013, 2:23:32 AM4/19/13
to cdlug_c...@googlegroups.com

伪造的Token应该不能访问google的API吧

B.Tag

unread,
Apr 19, 2013, 2:28:36 AM4/19/13
to cdlug_c...@googlegroups.com
我说伪造域名。。token 不能伪造
Reply all
Reply to author
Forward
0 new messages