首先进入谷歌应用 http://code.google.com/apis/console
创建一个project
在点击编辑,修改回调URL
编辑完后可以参照google开发文档开发
https://developers.google.com/accounts/docs/OAuth2?hl=zh-CN
然后按照需要下载对应的语言的client端
以PHP client 为例,需要修改src/config.php
1 |
// The application_name is included in the User-Agent HTTP header. |
2 |
'application_name' => '' , |
3 |
// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console |
4 |
'oauth2_client_id' => '' , |
5 |
'oauth2_client_secret' => '' , |
6 |
'oauth2_redirect_uri' => '' , |
7 |
// The developer key, you get this at https://code.google.com/apis/console |
8 |
'developer_key' => '' , |
DEMO:demo
授权
获取资料