草庐IT

auth_token

全部标签

php - 谷歌 API 客户端 "refresh token must be passed in or set as part of setAccessToken"

我目前面临一个非常奇怪的问题,实际上我一直在遵循来自GoogleAPI文档的指南(https://developers.google.com/google-apps/calendar/quickstart/php)。我尝试了两次,第一次它工作得很好,但在访问token过期后,GoogleAPIDoc直接提供的脚本无法刷新它。长话短说这是错误信息:sam@ssh:~$phpwww/path/to/app/public/quickstart.phpFatalerror:Uncaughtexception'LogicException'withmessage'refreshtokenmust

php - CakePHP 使用 Auth 记住我

我已经成功使用了Auth,但不幸的是,它似乎只适用于Session。我希望如果用户选中“记住我”复选框,我会使用Cookie,他会登录2周。我在官方书籍和谷歌中找不到任何东西,我只发现了很少而且不是很好的博客文章。有什么方法可以在不重写核心的情况下实现这一点? 最佳答案 在你的用户Controller中:publicfunctionbeforeFilter(){$this->Auth->allow(array('login','register'));parent::beforeFilter();}publicfunctionlog

php - CakePHP 使用 Auth 记住我

我已经成功使用了Auth,但不幸的是,它似乎只适用于Session。我希望如果用户选中“记住我”复选框,我会使用Cookie,他会登录2周。我在官方书籍和谷歌中找不到任何东西,我只发现了很少而且不是很好的博客文章。有什么方法可以在不重写核心的情况下实现这一点? 最佳答案 在你的用户Controller中:publicfunctionbeforeFilter(){$this->Auth->allow(array('login','register'));parent::beforeFilter();}publicfunctionlog

php - 为什么我的推特 oauth 访问 token 无效/过期

我正在使用Twitter将用户登录到一个网站,在我尝试获取有效的访问token之前,该网站似乎正在运行。require("twitteroauth.php");require'twconfig.php';session_start();$twitteroauth=newTwitterOAuth(YOUR_CONSUMER_KEY,YOUR_CONSUMER_SECRET);$request_token=$twitteroauth->getRequestToken('http://****/tw_response.php');$oauth_token=$request_token['oa

php - 为什么我的推特 oauth 访问 token 无效/过期

我正在使用Twitter将用户登录到一个网站,在我尝试获取有效的访问token之前,该网站似乎正在运行。require("twitteroauth.php");require'twconfig.php';session_start();$twitteroauth=newTwitterOAuth(YOUR_CONSUMER_KEY,YOUR_CONSUMER_SECRET);$request_token=$twitteroauth->getRequestToken('http://****/tw_response.php');$oauth_token=$request_token['oa

php - 在 PHP : random_bytes or openssl_random_pseudo_bytes? 中生成一次性 token

我需要在PHP中生成一次性token。我可以使用两个似乎做同样事情的函数:random_bytes和openssl_random_pseudo_bytes.例如,使用random_bytes:var_dump(bin2hex(random_bytes(12)));-->string(24)"338f489ec37a2c2b4943905d"并使用openssl_random_pseudo_bytes:var_dump(bin2hex(openssl_random_pseudo_bytes(12)));-->string(24)"1c7febea20029bd524fba8e7"open

php - 在 PHP : random_bytes or openssl_random_pseudo_bytes? 中生成一次性 token

我需要在PHP中生成一次性token。我可以使用两个似乎做同样事情的函数:random_bytes和openssl_random_pseudo_bytes.例如,使用random_bytes:var_dump(bin2hex(random_bytes(12)));-->string(24)"338f489ec37a2c2b4943905d"并使用openssl_random_pseudo_bytes:var_dump(bin2hex(openssl_random_pseudo_bytes(12)));-->string(24)"1c7febea20029bd524fba8e7"open

php - 在 laravel 护照客户端应用程序中使用访问 token 获取用户数据

我已经使用LaravelPassport文档成功创建了server.app和client.app。一切都按预期进行。client.app路由:Route::get('callback',function(Request$request){$http=newGuzzleHttp\Client;$response=$http->post('http://server.app/oauth/token',['form_params'=>['grant_type'=>'authorization_code','client_id'=>3,'client_secret'=>'secret','re

php - 在 laravel 护照客户端应用程序中使用访问 token 获取用户数据

我已经使用LaravelPassport文档成功创建了server.app和client.app。一切都按预期进行。client.app路由:Route::get('callback',function(Request$request){$http=newGuzzleHttp\Client;$response=$http->post('http://server.app/oauth/token',['form_params'=>['grant_type'=>'authorization_code','client_id'=>3,'client_secret'=>'secret','re

php - 如何通过 Facebook PHP SDK 获取 App Access Token?

我正在尝试检索我的应用程序的应用程序访问token以发布通知,但由于某种原因,它不起作用。代码如下:$AppParams=array('client_id'=>'myclientid','&client_secret'=>'myclientsecret','&grant_type'=>'client_credentials');$AppToken=$facebook->api('oauth/access_token?','GET',$AppParams);我还用完整的oauth/accesstoken链接替换了第一部分,但随后它返回了关于oauth及其facebook页面的一般信息,这