草庐IT

auth_key

全部标签

php - Kohana Auth 模块无法登录

对于那些熟悉Kohana中的Auth模块的人来说,我无法登录用户。我可以很好地创建用户,但显然哈希值不匹配。我已经使用提供的MySql模式来创建数据库,并且我正在使用模块模型。这是我创建的用户代码:publicfunctionuser_create(){$user=ORM::factory('user');$user->username="user";$this->auth=Auth::instance();$user->email="info@test.com";$user->password=$this->auth->hash_password('admin');$user->ad

php - openssl_pkey_export 和 "cannot get key from parameter 1"

我需要在我的php项目中使用openssl,所以我使用openssl创建了一个测试php页面。但是,我不断收到这些错误,我不确定为什么。openssl已启用。Warning:openssl_pkey_export()[function.openssl-pkey-export]:cannotgetkeyfromparameter1inC:\wamp\www\opensslsample\index.phponline18Warning:openssl_pkey_get_details()expectsparameter1toberesource,booleangiveninC:\wamp\

php - 将 array_key_exists 与 preg_match 结合使用

我正在尝试根据模式确定一个或多个匹配项是否存在于数组中,数组的例子:Array([author_id]=>1[channel_id]=>1[site_id]=>1[entry_id]=>6[url_title]=>test_title_with_file2[title]=>TestTitlewithfile[field_id_1_directory]=>1[field_id_4_directory]=>1[submit]=>Submit[entry_date]=>1278219110)我想确定field_id_x_directory键或多个键是否存在,如果存在,则循环遍历每个键并运行一

php - 自定义 is_unique_logical_key - 验证还是回调?

能否请我对以下问题提出设计建议:我正在使用Codeigniter/Grocery_CRUD。我的系统是Multi-Tenancy的-不同的自治站点-在同一个客户端中。我有很多具有唯一逻辑键的表实例。一种这样的表结构是:装备元素编号(pk)equip_type_id(fktoequip_types)site_id(fktosites)姓名其中(equip_type_id,site_id,name)在一起是我数据库中的唯一键。问题是,当使用grocery_CRUD表单添加或编辑违反此数据库规则的记录时-添加或编辑失败(由于数据库中的限制)但我没有得到任何反馈。我需要is_uniquefor

php - 在 CodeIgniter 中收到 "Disallowed Key Characters"错误

我收到以下消息:DisallowedKeyCharacters并且生成该消息的字符串似乎是__utmt_~42我只是想加载页面,但我终究无法弄清楚为什么会这样。它不知从何而来。我怎样才能找到它的来源? 最佳答案 按照以下步骤操作在/system/core/Input.php上搜索function_clean_input_keys将此exit('DisallowedKeyCharacters.');更新为exit('DisallowedKeyCharacters.'.$str); 关于ph

nacos2.2启动报错The specified key byte array is 16 bits which is not secure enough for any JWT HMAC-SHA

1.问题描述这几天搭建了一个微服务项目,使用nacos2.2来做注册和配置中心,但是启动nacos的时候发现报错,查看log后发现报的是,Causedby:io.jsonwebtoken.security.WeakKeyException:Thespecifiedkeybytearrayis16bitswhichisnotsecureenoughforanyJWTHMAC-SHAalgorithm. TheJWTJWASpecification(RFC7518,Section3.2)statesthatkeysusedwithHMAC-SHAalgorithmsMUSThaveasize>=2

php - Laravel 5.2 Auth facade 和 Auth::guard($guard)

我是Laravel的新手。我正在浏览默认的身份验证中间件,我看到它正在使用:Auth::guard($guard)->guest()检查用户是否是访客。文档位于https://laravel.com/docs/5.2/authentication#retrieving-the-authenticated-user告诉我们可以使用:Auth::check()确定用户是否通过身份验证。(我想这与guest()相反?我尝试更改要使用的默认代码Auth::guest()我得到了完全相同的结果。我的问题是,在这种情况下,有没有guard($guard)->有什么区别?一个相关的问题。guest(

php - 防护 'Google_Auth_Exception' 获取 OAuth2 访问 token 时出错,消息 : 'invalid_client' ' error

我正在尝试通过gmailapi从Google获取邮件在收到token后对Google_Client进行身份验证时出现此错误fatalerror:未捕获异常“Google_Auth_Exception”,消息“获取OAuth2访问token时出错,消息:‘invalid_client’”在我的代码使用google-api-php-client-master很简单,我的代码如下require_once('config.php');require_once'autoload.php';$client=newGoogle_Client();$client->setScopes(array('h

php - Laravel-5 添加 hasRole 方法到 Auth

我正在尝试扩展Laravel-5.1Auth中间件,以便我可以向其中添加我自己的方法:Auth::hasRole()我需要做什么才能将新方法hasRole添加到Auth?这是我的路线文件:/*AdministratorRoutes*/Route::group(['namespace'=>'Admin','middleware'=>'timesheets.admin:Administrator'],function(){Route::get('home','AdminController@index');});这是我的中间件文件:auth=$auth;}/***Handleanincom

php - 如何在 Codeigniter RSA 库中生成签名和 key

我正在使用codeigniter框架在php中进行一些加密和解密。我正在使用这个库https://github.com/Dirktheman/rsa-codeigniter-library.我想要做的是生成这样的签名encrypt_method(value,private_key)。这将返回签名。然后我想验证等于先前值的值或不解密(签名,previous_input,public_key)。我的问题是没有生成私钥和公钥的方法。也用于生成签名。那么,如何在PHP中使用RSA库来实现它呢? 最佳答案 不要使用那个库。这是完全不安全的。安