Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wenbinye/oauth2-demo
OAuth2 Server and Client Demo
https://github.com/wenbinye/oauth2-demo
Last synced: 2 months ago
JSON representation
OAuth2 Server and Client Demo
- Host: GitHub
- URL: https://github.com/wenbinye/oauth2-demo
- Owner: wenbinye
- Created: 2013-02-28T13:59:09.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-19T18:32:10.000Z (over 11 years ago)
- Last Synced: 2024-04-16T20:10:37.517Z (9 months ago)
- Language: PHP
- Size: 156 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
OAuth2 服务器实现和客户端调用示例
==========演示如何使用 [oauth-server-php][oauth-server-php] 搭建一个 oauth2 服务器,
并使用 [PHP-OAuth2][PHP-OAuth2] 进行验证并调用服务器的接口。使用 [Composer][Composer] 可以快速安装依赖库:
$ git clone git://github.com/wenbinye/oauth2-demo.git
$ cd oauth2-demo
$ curl -s http://getcomposer.org/installer | php
$ composer.phar install配置好 Web 服务器后在浏览器中打开 *http://your-host/index.php/client/index*
为了区分 oauth 客户端和 oauth 服务器,可以通过修改本机 host 文件,添加一个虚拟域名:
your.server.ip oauth.host
然后修改 *protected/config/main.php* 中 *params*:
```php
'oauthServerHost' => 'oauth.host'
```[Composer]: http://getcomposer.org/
[oauth-server-php]: https://github.com/bshaffer/oauth2-server-php
[PHP-OAuth2]: https://github.com/adoy/PHP-OAuth2