草庐IT

remember_token

全部标签

php - 使用 google api 客户端 php 刷新 token

我对googleapi的痛苦仍在继续......我能够使用脚本来使用刷新token-自动刷新并保持我对日历的访问。我可以与日历交互,一切都很好。我现在想继续使用php的googleapi客户端,昨天我的token有效时我已经开始工作了,但现在它已经过期了,我不知道如何使用刷新token来获取新token并在将来过期后继续进行身份验证。我找到了许多引用资料并尝试了这些-这是我目前基于simple.php示例的测试脚本:setAccessType('offline');$client->setApplicationName("DownsGolfmanager");//Visithttps:

php - 具有公共(public)访问权限的 Web 应用程序的 Google OAuth 2.0 刷新 token

我收到以下错误:TheOAuth2.0accesstokenhasexpired,andarefreshtokenisnotavailable.Refreshtokensarenotreturnedforresponsesthatwereauto-approved我有一个只有我的服务器可以访问的Web应用程序,初始身份验证工作正常,但一个小时后,会弹出上述错误消息。我的脚本如下所示:require_once'Google/Client.php';require_once'Google/Service/Analytics.php';session_start();$client=newG

php - jQuery.ajax 返回错误 : Unexpected token with Error Message: parseerror?

我有一个调用php脚本的jquery.ajax例程。php脚本在Google搜索API上进行查找,并将json返回给调用ajax脚本。该脚本在99%的安装上运行良好,但是,在少数情况下,当我调用时:error:function(jqXHR,textStatus,errorThrown){alert('HTTPError:'+errorThrown+'|ErrorMessage:'+textStatus);}它返回:HTTPError:SyntaxError:Unexpectedtokenparsererror如何使用javascript控制台或chrome开发人员工具解决此问题?代码s

php - 模板文件中的 Drupal token 替换

我可以在Drupal模板文件中使用token替换吗?我正在尝试这个:$author_uid="[node:author:uid]";$nid="[node:nid]";但它不起作用。我如何在我的node.tpl.php模板中正确使用token替换? 最佳答案 知道了!!这对我有用:$author_uid=token_replace('[node:author:uid]',array('node'=>$node));$nid=token_replace('[node:nid]',array('node'=>$node));您必须将$n

php - 如何在 PHP cURL 中提供 Youtube 身份验证 token

正在关注this指南,我正在尝试检索Youtube用户的订阅。我能够获得用户的身份验证token,但我不知道如何使用我的cURL请求实际发送它。文档只是这样说:Torequestafeedofthecurrentlylogged-inuser'ssubscriptions,sendaGETrequesttothefollowingURL.Note:Forthisrequest,youmustprovideanauthorizationtoken,whichenablesYouTubetoverifythattheuserauthorizedaccesstotheresource.htt

php - 在 Laravel 中为 CSRF token 设置 httpOnly 标志

我正在为客户在Laravel5.1中构建应用程序。在我完成应用程序后,我得到了一份渗透测试报告,告诉我添加一个HttpOnly标志。我在app/config/session.php中添加了'secure'=>true和'http_only'=>true。除了XSRF-TOKENsession之外,所有session都设置了httpOnly标志。我怎样才能设置这个标志呢? 最佳答案 您可以覆盖App\Http\Middleware\VerifyCsrfToken中的addCookieToResponse($request,$respo

javascript - SyntaxError : Unexpected token < in JSON at position 0 at Object. 解析( native )(AngularJS)

我使用php脚本(save-data.php)成功地将我的数据保存到一个json文件中,但我无法使用我的get-data.php脚本正确获取它。错误消息:angular.js:12520SyntaxError:JSON中Object.parse位置0处的意外标记保存数据.php:get-data.php:保存数据.json:{"id":"179","var1":"variable1","var2":"variable2"}示例Controller://savedata(myModel:id,var1,var2)$scope.save=function(){console.log('Cr

php - 散列 "remember me"cookie token 的最佳方法

我正在尝试实现“记住我”功能,遵循此处提供的指南:Thedefinitiveguidetoform-basedwebsiteauthentication,这里:http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/“cookietoken”似乎在存储在数据库中时应该经过哈希处理(如果攻击者可以访问数据库,未哈希的token看起来像普通的登录名/密码,允许登录网站)。在寻找一个好的哈希算法时,我发现了使用bcrypt的推荐技术:https://stackoverflow.com/a/63

php - Google API PHP 刷新 token 返回 NULL

我正在使用适用于PHP的GoogleAPI客户端库进行离线身份验证,但是当我使用此代码时:$this->google->refreshToken($result["google_refresh_token"]));它返回NULL。$this->google指的是Google_Client类的一个实例。有人知道这可能是什么吗?如果我尝试更改给定的刷新token,它会返回Google异常错误,因此它应该是一个有效token。谢谢!编辑:'client_id'=>'myclientid','client_secret'=>'myclientsecret','redirect_uri'=>'m

php - Facebook PHP SDK 4.0 : Getting Long Term Access Token

我正在尝试使用PHPsdkv4.0获取用于PAGE管理的长期访问token。我正在从用户的登录中获取访问token(是的,我正在获取页面特定的访问token)。然后将其发送到文档中指定的端点,但我没有得到任何结果,也没有收到任何错误。我能知道要使用的正确代码片段是什么吗?这是我目前使用的代码$endpoint='/oauth/access_token?';$endpoint.='grant_type=fb_exchange_token&';$endpoint.='client_id='.$this->app_id.'&';$endpoint.='client_secret='.$thi