草庐IT

rest-auth

全部标签

php - 如何配置 CakePHP 的 $this->Auth->login() 以使用自定义密码哈希

CakePHPv.2.4...我正在关注thisdocumentation尝试设置Auth组件以使用我的自定义密码哈希类:App::uses('PHPassPasswordHasher','Controller/Component/Auth');classAppControllerextendsController{//authneededstuffpublic$components=array('Session','Cookie','Auth'=>array('authenticate'=>array('Form'=>array('fields'=>array('username'=

PHP REST 下载文件

我有一个具有这样功能的网络服务$app->get('/downloadPdf',function()use($app){$log='example.pdf';$res=$app->response();$res['Content-Description']='FileTransfer';$res['Content-Type']='application/octet-stream';$res['Content-Disposition']='attachment;filename='.basename($log);$res['Content-Transfer-Encoding']='bin

php - Laravel 的 Auth::attempt() 返回 true 但 Auth::check() 返回 false

如标题所示,Laravel的函数Auth::attempt()返回true如下代码部分(删除了不重要的部分):publicfunctiondoLogin(){$validator=[..]if($validator->fails()){[..]}else{$userdata=array('username'=>Input::get('username'),'password'=>Input::get('password'));if(Auth::attempt($userdata,true)){returnRedirect::to('/');}else{returnRedirect::t

php - Laravel Elfinder 在使用 'auth' 中间件时重定向到主页

我正在使用https://github.com/barryvdh/laravel-elfinder每当我在config/elfinder.php文件中将middleware设置为auth时,我都会被重定向到主页,但是当我使用middleware来NULL,elfinder可以正常打开。如何在laravel中保护elfinder的路由,以便只允许访问的用户打开文件管理器?谢谢 最佳答案 解决方案是在config\elfinder.php文件中使用web作为另一个中间件。所以,解决方案就变成了'middleware'=>"['auth'

php - Laravel - JWT Auth 无法从请求中解析 token

我在我的中间件中添加了以下代码,用于使用JWTAuth进行用户身份验证,它适用于中间件处理的所有路由。publicfunctionhandle($request,Closure$next){if($request->has('token')){try{$this->auth=JWTAuth::parseToken()->authenticate();return$next($request);}catch(JWTException$e){returnredirect()->guest('user/login');}}}但是对于使用PostMethod的一条路线,其中token已正确传递

php - 调用未定义的方法 Illuminate\Auth\TokenGuard::attempt()

我收到这个错误:CalltoundefinedmethodIlluminate\Auth\TokenGuard::attempt()来自这段代码:if(Auth::guard('admin')->attempt(['email'=>$request->email,'password'=>$request->password],$request->remember)){returnredirect()->intended(route('admin.dashboard'));}else{我已经导入了Illuminate\Support\Facades\Authasthedocssugges

php - Newsletter2Go REST API - 如何将新收件人添加到列表中?

是否可以通过Newsletter2Go的RESTAPI添加新的收件人?我这样试过(片段):publicfunctionsubscribeAction(){$this->init();$email=$this->getRequest()->getParam('email');$gender=$this->getRequest()->getParam('gender');$first_name=$this->getRequest()->getParam('first_name');$last_name=$this->getRequest()->getParam('last_name');$

php - REST API——Javascript 还是 PHP?

按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visitthehelpcenter指导。关闭11年前。通过RESTAPI,我可以接收XML或JSON格式的响应。例如,这可以使用PHP或Javascript(使用jQuery)来完成。我想知道不同语言的优点和缺点。到目前为止,这是我想通的:当稍后需要在服务器端使用数据时,PHP似乎比JavaScript更容易。JavaScript在客户端运行,在使用外部URL获取数据时不会对服务器造成负载

php - SugarCRM 账户联系关系 REST API

在SugarCRM6.0.0中,我需要通过REST网络服务API在帐户和联系人之间创建关系。我已经尝试了两种方法(帐户->联系人,联系人->帐户)都无济于事:$method='set_relationship';$params=array('module_name'=>'Accounts','module_id'=>$accountId,'link_field_name'=>'accounts_contacts','related_ids'=>array($userId));$method='set_entry';$params=array('module_name'=>'Contac

php - 创建新的 magento Rest api 以获取 magento 中的类别列表

有谁知道如何创建新的magentorestapi来获取类别列表。我已经看过这个链接magentorestapi但这不会获取类别列表。如果有人知道,请解决这个问题.. 最佳答案 首先使用http://www.silksoftware.com/magento-module-creator/创建基本模块然后您必须创建以下文件并将此文件添加到给定路径中。模块路径=app/code/local/Restapi/Categories1)app/code/local/Restapi/Categories/etc/api2.xmlCatalog10