Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于PHP的Oauth 2.0服务器和请求库_Php_Codeigniter_Curl_Oauth - Fatal编程技术网

用于PHP的Oauth 2.0服务器和请求库

用于PHP的Oauth 2.0服务器和请求库,php,codeigniter,curl,oauth,Php,Codeigniter,Curl,Oauth,我正在学习OAuth2.0库。 我读了一些关于Oauth 2.0服务器的文章 在github.com/grasses/CodeIgniter-oauth2-Server中查找CodeIgniter的oauth2.0服务器之后 我需要的是模拟在包含一些api的服务器中获取访问授权。首先,我在命令行中模拟这一点: curl -u testclient:testpass http://localhost/token.php -d 'grant_type=client_credentials' 获取令

我正在学习OAuth2.0库。 我读了一些关于Oauth 2.0服务器的文章

在github.com/grasses/CodeIgniter-oauth2-Server中查找CodeIgniter的oauth2.0服务器之后

我需要的是模拟在包含一些api的服务器中获取访问授权。首先,我在命令行中模拟这一点:

curl -u testclient:testpass http://localhost/token.php -d 'grant_type=client_credentials'
获取令牌后,我运行此命令以获取资源访问权限:

curl http://localhost/resource.php -d 'access_token=MY_TOKEN'
回复正常,我可以访问资源


我所需要的只是知道是否存在一种通过向Oauth 2.0服务器发出令牌请求来实现客户机请求的方法。任何帮助都将不胜感激

如果您在使用您选择的库和后代码示例实现这些请求方面做出了一些努力,那就太好了,请参见示例