草庐IT

SECURITY_DOMAIN

全部标签

php - 使用 Symfony Security 的简单登录表单

我试着用这个教程做登录表单:http://symfony.com/doc/current/cookbook/security/form_login_setup.html所以,现在我的security.yml文件如下所示:security:providers:in_memory:memory:users:ryan:password:ryanpassroles:'ROLE_USER'admin:password:kittenroles:'ROLE_ADMIN'encoders:Symfony\Component\Security\Core\User\User:plaintextfirewa

php - Symfony 3.3 从 3.2 : Compile Error: Cannot declare class Symfony\Bundle\SecurityBundle\Security\FirewallMap

自从我从symfony3.2更新到3.3后我遇到了一些问题,我得到了这个错误CompileError:CannotdeclareclassSymfony\Bundle\SecurityBundle\Security\FirewallMap,becausethenameisalreadyinuseinclasses.php(line1709)inClassCollectionLoader.php(line99)atClassCollectionLoader::load()inKernel.php(line428)atKernel->doLoadClassCache()inKernel.p

php - 带有自定义选民的 Symfony @Security 注释

我编写了一个自定义投票器来检查用户是否是他正在尝试编辑的一本书的所有者。因此我使用“@Security”注解来保护Controller:@Security("is_granted('BookVoter::ATTRIBUTE_OWNER',book)")这就是我希望@Security注释看起来像的样子,但它仅在我编写以下内容时有效:@Security("is_granted('OWNER',book)")我不想“硬编码”“OWNER”字符串,它在我的BookVoter中是一个常量。有什么想法可以实现吗?问候。 最佳答案 您传递给@Se

php - API 安全 : how to restrict access by domain?

我公开了一个简单的API,需要确保只有授权用户才能访问它。我将提供一个APIkey来进行身份验证。但是,我还想将APIkey关联到某个域(意思是,它应该只有在从授权域使用时才有效)。如果从授权域访问,我如何检查API端?HTTP_REFERER显然不可靠。有什么建议吗? 最佳答案 您要公开哪种API?有许多不同类型的API-我假设您没有公开操作系统的API...假设您想要公开一些网络应用程序的API,您可以看看OAuth,它基于回调URL-您可以只阻止某些域通过回调URL被调用。阅读更多关于OAuth的信息.

php - 如何将 http ://domain. com 重定向到 https ://www. domain.com?

我已经获得了SSL证书。我安装了Wordpress,请在下面的hostgator文件管理器中查看文件夹结构:我已经把define('FORCE_SSL_ADMIN',true);放在了wp_config.phpWordPress常规设置:WordPress地址(网址):https://www.domain.com/blog站点地址(URL):https://www.domain.compublic_html->blog(insideisthewordpressinstallation)databasestructure->wp_options->siteurl:https://www.

php - 在共享主机环境中关闭页面的 mod_security

当我通过其他页面发布方法发布一些html和javascript混合数据时,我的页面显示错误禁止访问错误。但是当我直接打开该页面时,它正确显示,没有任何错误。我在发布数据时知道这是与服务器安全相关的问题。当我搜索时,我在.htaccess文件中找到了Turnoffmod_security的解决方案。但我只想为这个页面而不是我的整个网站这样做。我的托管环境是共享的。但我可以编辑我的.htaccess文件。 最佳答案 看看一些mod_securityand.htaccesstricks.有很多不同的方法可以启用或禁用mod_sceurit

php - 将 www.domain.com/example.com 重定向到 example.com

很多年前我读到有一个简单的php脚本可以将您的网站重定向到http://example.com/google.com到google.com它适用于正斜杠右侧的任何域。我忘记了这个脚本是什么或在哪里可以找到它 最佳答案 如果您在文档根目录中创建一个htaccess文件,并添加:RewriteEngineOnRewriteRule^/?([a-z0-9-.]+)$http://$1/[L,R] 关于php-将www.domain.com/example.com重定向到example.com,

php - Symfony.4 Sonata AdminBundle 注销错误 : You must activate the logout in your security firewall configuration

登录正常。在/admin/logout出现错误Youmustactivatethelogoutinyoursecurityfirewallconfiguration.在在*\vendor\sonata-project\user-bundle\Controller\AdminSecurityController.php第98行我按照记录将注销设置为true:安全.yml:firewalls:main:pattern:.*#pattern:^/form-login:provider:fos_userbundlecsrf_provider:form.csrf_providerlogin_pa

php - 什么是 MediaWiki 中 AuthPlugin 上下文中的 "domain"?

我在写我自己的AuthPlugin对于MediaWiki,并引用thedoc和thecode官方提供。域有几个函数:AuthPlugin::domainList()//Getalistofdomains(inHTMLFormoptionsformat)used.AuthPlugin::getDomain()//Gettheuser'sdomain.AuthPlugin::setDomain($domain)//Setthedomainthispluginissupposedtousewhenauthenticating.但是,我不明白什么是域,它应该是什么?它是AuthPlugin扩展

php - 使用node.js替换apache/nginx并执行php security

我有一个用node.js编写的网络服务器,它几乎只为用户提供静态文件。要向其添加PHP支持,我想我可以只下载PHP并将文件提供给PHP.exe。如果它供单个用户使用,那是可行的并且就足够了。对于多个用户将其网站托管在服务器上的环境,它会带来巨大的安全问题。可以使用PHP脚本对任何其他网站甚至整个服务器执行他/她想要的任何操作。哦,我有没有提到它是一个Windows服务器?无论如何,我想要的是获得一些权限以将php脚本保存在特定目录中。我正在考虑为每个网站创建一个用户,我将在该网站上应用适当的权限,而不是在使用“运行方式”之类的东西执行php.exe时(假设它是可能的)。我还有其他方法可