symfony-security 相关问题


将 Spring Security 5 迁移到 Spring Security 6 HttpSecurity 问题

Spring Security 6 中以下代码应该替代什么? http .authorizeRequests() .requestMatchers("/hub/**").access("hasPermission('SOME_LAYER', '')")...


如何覆盖symfony2核心FrameworkBundle?

我正在尝试覆盖位于供应商/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php的Symfony2路由器 我已经按照本教程创建了自己的捆绑包并注册...


Symfony 5 - “驱动程序中发生异常:找不到驱动程序”

我目前面临这个问题。我真的是 Symfony 的新手。 问题 : 当我使用 cli symfony 控制台原则创建新数据库时:database:create,我收到以下错误: 在


Symfony 6 串行器

嗨,我需要使用 symfony 6 对这些数据进行非规范化 数组:4 [ “createdAt” => 数组:3 [ “日期”=>“2024-01-09 17:04:37.209330” “时区类型”=...


如何使用spring security 6为AuthenticationManager的参数2定义bean?

我是 Spring Security 6 的新手。当我尝试配置安全性时,出现此错误: ************************** 应用程序无法启动 ************************** 描述:


Symfony 6.0 - 在控制器中强制注销用户

我如何强制注销从新 Symfony 6 上的 controle 登录的用户? (6.0.1版本) 我尝试了 $tokenStorage->setToken($token);但 setToken() 需要 2 个参数: (公共函数 setToken(string $tok...


authorization_code 授权类型的 unsupported_grant_type 错误:Spring Security OAuth2

我正在尝试使用 Spring Security 通过 OpenID Connect 实现 OAuth2 授权服务器。 为此,我使用带有刷新令牌和 JWT 的授权代码流程。这是我的配置...


Symfony 7 带有附加参数的 CollectionType

多年后我又回到了 Symfony,我很喜欢这个新版本 7。 我正在与 CollectionType 作斗争,因为我只需要显示基于主对象的某些字段,但我找不到...


如何为我的 symfony 应用程序设置 varnish?

我想在我的 symfony 应用程序中使用 varnish 进行缓存控制, 我使用过虚拟主机,这是我的虚拟主机文件。 ServerAdmin webmaster@localhost 服务器名称 varn...


无法提取响应:在 springn oauth2client 代码中找不到适合响应类型的 HttpMessageConverter

我正在尝试实现 spring security oauth2client。 我使用 springboot 3。我也实现了 spring security oauth2 授权服务器。 当我启动客户端应用程序时,我得到


Spring Security 6 POST 请求未经permitAll()授权

我正在使用 Spring Boot 3、Spring Security 6。我的安全配置无法正常工作。我有 2 条路径,任何请求都应该被允许,而对于其他所有请求,都需要进行身份验证...


ASP.Net 表单 - Content-Security-Policy 随机数值不适用于内联脚本

net 空 webform 项目并添加 1 个按钮、1 个内联脚本(按钮中使用的 1 个函数)并为 Content-Security-Policy 设置声明 1 个元标记。 我的意图是想在我的...


PhpStorm 和 Symfony 3 - 对于某些捆绑包,找不到命名空间

我在 Symfony 3 中的一些包的命名空间在 PhpStorm 中无法识别。 它影响: 我自己的包和 外部捆绑包(在供应商文件夹中),例如 FOM-Rest-Bundle (另见...


Duo Security Admin API 用户请求在 Java 中使用失败

我正在使用 Duo Security Admin API。但是当我使用下面的代码调用 api 时,它显示: 获取用户请求因 HTTP 失败(响应代码:401) 这是我的java代码: 无效用户(){ // 双广告...


如何在Spring Security中检查每个请求的用户状态

我正在使用 spring security 并实现了 UserDetailsService ,它完美地处理了我的用户登录过程。 问题是这样的: 是否有一种标准方法可以从数据库中检查用户状态


安装 Symfony 调试栏在 6.5.7.3 中不起作用

我已经(本地,Mamp)安装了最新的 Shopware (6.5.7.3)。但是如果我尝试使用以下命令安装 Symfony 调试工具: 作曲家需要商店软件/开发工具 我收到此错误: 问题1 - 符号...


Symfony 5.3 - 为什么我的记住我功能不起作用?

我刚刚将我的 symfony 4.4 应用程序升级到 5.3 以使用一些新的很酷的东西(UX,UUID,..)。所以我开始了一个新项目并运行 make:auth 命令来创建安全组件最新


symfony 包中的服务依赖于应用程序中的服务

TLDR:我正在创建一个 Symfony 6 捆绑包,它提供的服务依赖于利用应用程序将提供的接口实现为服务。 我正在创建的捆绑包提供了一项服务...


创建名为“springSecurityFilterChain”的 bean 时出错

我一直在关注Spring Security Reference,我只添加了这些类: @配置 @EnableWebMvcSecurity 公共类 WebSecurityConfig 扩展 WebSecurityConfigurerAdapter { @


具有多个数据库的 postgresql 上的 Symfony 6 学说问题 SQLSTATE[42P01]:未定义的表:7 ERROR

我的 Symfony 项目(sf v6)使用 postgresql/postgis 和 2 个数据库:主要一个包含特定业务数据,第二个称为 Web 服务数据库,其中多个共享数据


Spring Security 循环依赖

我的 SecurityConfiguration 和 CustomAuthenticationFilter 之间存在循环依赖关系。我认为 AuthenticationManager 是问题所在,我无法解决它。 安全配置 @


Symfony 用户违反完整性约束

我收到以下错误 [申请] 1月5日 00:03:10 |CRITICA| CONSOL 运行命令“make:migration”时抛出错误。消息:“执行


当我在 docker 上和所有配置文件中设置 mysql 时,Symfony 5 继续查看 postgre 数据库

我是 Symfony 5.4/Docker 的新手,我试图了解如何连接到 docker mysql 数据库。 我正在启动一个项目,其中我将使用在带有 Docker (mysql) 的远程计算机上运行的数据库。所以,...


Spring security 6.2 JSESSIONID 未返回

我正在使用 Kotlin 创建一个 Spring Boot 应用程序。我已经将 WebSecurity 配置为: @配置 类安全配置{ @Autowired Lateinit var dataSource: 数据源 @值(...


/admin/v1/users 在 DUO Security Admin API 中给出 40103

我正在尝试使用它显示的 /admin/v1/users 创建 { “代码”:40103, "message":"请求凭证中的签名无效", “统计”:“失败” } 哈...


bean“mvcHandlerMappingIntrospectorRequestTransformer”无法注册。具有该名称的 bean 已被定义并覆盖 i

环境:Spring Boot 3.2.1、JDK 21、GraalVM、Spring Native、Spring Security。错误 微软Windows [版本10.0.22631.2861] (c) 微软公司。版权所有。 。 ____ ...


SSAS/Power BI 行级安全性

我一直在使用 radacad 创建的一些非常有用的文章(例如 https://radacad.com/dynamic-row-level-security-with-manager-level-access-in-power-bi),使我能够添加一些行级安全...


Symfony 中的日期时间反序列化

我正在尝试在 API 端点中反序列化 JSON 对象,但遇到了一些问题。 我正在使用 #[MapRequestPayload] 属性和默认 SerializerInterface 实现。跑步


onMounted 当没有要关联的活动组件实例时调用

Symfony/VueJS 组件 // 导入 从“../hooks/getUser”导入 getUser; 从 'vue-router' 导入 { useRoute } // 增值服务 常量路由 = useRoute() 常量 { 用户 } = getUser(1) const 路线我...


如何在会话 Laravel 中存储输入

我是 Laravel 的新手,我尝试将我的输入表单发布到会话中,但它不起作用,我收到此错误,但没有任何消息: Symfony \ 组件 \ HttpKernel \ 异常 \


如何使用 API Platform 和 Gedmo Translatable 查询可翻译属性

我正在使用 Symfony 6 + API 平台 + Gedmo Translatable。 更新/发布项目工作正常并正确存储翻译。 另外,以正确的语言获得集合是......


Symfony Doctrine:orderBy JSONb 字段?

有没有办法通过学说中的特定jsonb字段进行排序? 表示例: ID 人物数据 薪水 1 {'姓名':'约翰·史密斯','号码':13} 10000 2 {'姓名':'无名氏','号码':192} 11000 2 {'呐...


Symfony/Twig 在 if 条件下设置变量

我知道这真的很微不足道,也不那么重要,但它可以节省我的一生...... 您知道可以在 PHP 中的 if 块中声明变量 if( $row = $sql->fetch ){ //做一些事情...


Spring Security 6 中 BCryptPasswordEncoder 注册和登录密码不匹配

这个问题我找了好久都没有解决,看了很多东西,还是不明白。 一般来说,我有一个用户注册表单(Thymeleaf),其中的数据传输到...


Websockets 和 Spring Boot Security 的错误 401

我正在使用 Spring Boot 3.1.0,我正在尝试在我的应用程序中实现一些 websockets。我正在按照互联网上的教程来实现它们并生成一些统一的测试以确保......


从异步操作获取数据

在 Symfony 6 中,我需要调用第一个对象(名为 Script),然后这个对象将调用第二个对象(规则),这个规则将调用执行各种操作的最后一个对象(条件)。 ..


Spring Boot api 在多次成功的 200 响应后给出 403

我有一个 Spring Boot 应用程序,它使用 spring security 作为依赖项。我正在将 Spring boot 版本从 2.7.16 迁移到 3.2.1。在 2.7.16 版本中一切正常。但在 3.2.1 中,其余 API 都...


如何修复“在索引 0 处找到带有非文字参数的 fs.readFile”?

我正在尝试在 TypeScript 项目中添加 eslint-plugin-security。然而,对于这些代码 从 'fs' 导入 { Promise as fsp }; 从 'fs' 导入 fs; 从“路径”导入路径; 常量索引=等待...


Symfony 的 NumberType 作为 HTML5 输入字段和自定义区域设置

我的应用程序更喜欢 de 作为区域设置来显示数字,如 1.234.567,89 而不是 1,234,567.89(或 1234567,89 而不是 1234567.89)。 所以我更改了 config.yml 中的本地参数: 参数...


在 Springdoc 中自动生成基于 Swagger 注释的描述

基本上我的问题与这个相同,但是针对Springdoc(而不是Springfox)。 简而言之,我有一个 Spring-boot 应用程序,并且我正在使用 spring-security @PreAuthorize 注释来保护我的一些......


配置 SAML2:绕过“InResponseTo”验证,同时保留 OpenSaml4AuthenticationProvider 中的默认设置

我有一个在 Nginx 和 Spring Security 后面运行的 Java 后端应用程序用于 SSO。我的后端应用程序缺乏记住 cookie 会话的机制,因为 SSO 请求可能由...发起


为什么 CORS 配置为允许任何访问,登录时仍然出现 401 Unauthorized 错误?

经过几天的尝试解决以下问题后,我对以下问题感到不知所措。 我构建这个项目的上下文是 React/Axios/Spring Boot 3/Spring Security 6。 我收到 401 CORS unauthor...


Doctrine 2.2+ 想要重新创建我的所有表,因为它试图使用错误的 postgres 架构

我在 symfony 2.0 项目上将原则从 2.1 更新到 2.2。 但现在每次我尝试执行 php app/console 学说:schema:update 学说都想重新创建我的所有架构,并且我有以下内容...


Doctrine 2.2+ 想要重新创建我的所有表,因为它试图使用错误的 postgres 架构

我在 symfony 2.0 项目上将原则从 2.1 更新到 2.2。 但现在每次我尝试执行 php app/console 学说:schema:update 学说都想重新创建我的所有架构,并且我有以下内容...


具有 TimestampableEntity 特征的实体在 PUT 操作中失败

我正在全新安装 API Platform (v3.2.7),并且使用 Gedmo\Timestampable\Traits\TimestampableEntity 这是我的实体(问候语示例) 我正在全新安装 API Platform (v3.2.7),并且正在使用 Gedmo\Timestampable\Traits\TimestampableEntity 这是我的实体(问候语示例) <?php namespace App\Entity; use ApiPlatform\Metadata\ApiResource; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use Gedmo\Timestampable\Traits\TimestampableEntity; #[ApiResource] #[ORM\Entity] class Greeting { use TimestampableEntity; #[ORM\Id] #[ORM\Column(type: "integer")] #[ORM\GeneratedValue] private ?int $id = null; #[ORM\Column] #[Assert\NotBlank] public string $name = ""; public function getId(): ?int { return $this->id; } } 和我的 config/services.yaml gedmo.listener.timestampable: class: Gedmo\Timestampable\TimestampableListener tags: - { name: doctrine.event_listener, event: 'prePersist' } - { name: doctrine.event_listener, event: 'onFlush' } - { name: doctrine.event_listener, event: 'loadClassMetadata' } 它在 POST 操作上工作正常,但在执行 PUT 时失败。我收到此错误 执行查询时发生异常:SQLSTATE[23000]: 完整性约束违规:1048 列“created_at”不能 空 我使用的版本是:symfony 6.4.1,doctrine 2.12,gedmo 3.14 我最终做的是使用 PATCH 而不是 PUT。所以我可以编辑部分实体,并且特征仍然更新 updated_at 字段


使用python的mechanize自动网站登录

我正在尝试自动登录一个网站,该网站的登录表单具有以下 HTML 代码(摘录): 我正在尝试自动登录一个网站,其登录表单具有以下 HTML 代码(摘录): <tr> <td width="60%"> <input type="text" name="username" class="required black_text" maxlength="50" value="" /> </td> <td> <input type="password" name="password" id="password" class="required black_text" maxlength="50" value="" /> </td> <td colspan="2" align="center"> <input type="image" src="gifs/login.jpg" name="Login2" value="Login" alt="Login" title="Login"/> </td> </tr> 我正在使用python的mechanize模块进行网页浏览。以下是代码: br.select_form(predicate=self.__form_with_fields("username", "password")) br['username'] = self.config['COMMON.USER'] br['password'] = self.config['COMMON.PASSWORD'] try: request = br.click(name='Login2', type='image') response = mechanize.urlopen(request) print response.read() except IOError, err: logger = logging.getLogger(__name__) logger.error(str(err)) logger.debug(response.info()) print str(err) sys.exit(1) def __form_with_fields(self, *fields): """ Generator of form predicate functions. """ def __pred(form): for field_name in fields: try: form.find_control(field_name) except ControlNotFoundError, err: logger = logging.getLogger(__name__) logger.error(str(err)) return False return True return __pred 不知道我做错了什么...... 谢谢 该网站有可能在登录期间使用java脚本进行回发。我记得很清楚,对于 ASP .Net 站点,您需要获取隐藏表单字段,例如 VIEWSTATE 和 EVENTTARGET 并将它们发布到新 Page 。 您为什么不发送问题网站的链接?之后就变得相对容易弄清楚了 尝试使用 Selenium 和 PhantomJS from selenium import PhantomJS import platform if platform.system() == 'Windows': # .exe for Windows PhantomJS_path = './phantomjs.exe' else: PhantomJS_path = './phantomjs' service_args = [ # Proxy (optional) '--proxy=<>', '--proxy-type=http', '--ignore-ssl-errors=true', '--web-security=false' ] browser = PhantomJS(PhantomJS_path, service_args=service_args) browser.set_window_size(1280, 720) # Window size for screenshot (optional) login_url = "<url_here>" # Credentials Username = "<insert>" Password = "<insert>" # Login browser.get(login_url) browser.save_screenshot('login.png') print browser.current_url browser.find_element_by_id("<username field id>").send_keys(Username) browser.find_element_by_id("<password field id>").send_keys(Password) browser.find_element_by_id("<login button id>").click() print (browser.current_url) browser.get(scrape_url) print browser.page_source browser.quit() ''' python 和 pycharm 设置路径变量 点维辛检查 包管理器 python 如何安装新版本 python最新版本 - python 3.7.2 用户环境变量 蟒蛇 pyton 中的命令行 '''


防止打开的窗口覆盖 opener 的 `close` 方法

我有一个 test1.html 文件,仅包含以下代码: janela = window.open("http://localhost/test2.html","_blank","width=1000,height=400,left=600,top=0"); </...</desc> <question vote="1"> <p>我有一个 <pre><code>test1.html</code></pre> 文件,其中仅包含以下代码:</p> <pre><code>&lt;script&gt; janela = window.open(&#34;http://localhost/test2.html&#34;,&#34;_blank&#34;,&#34;width=1000,height=400,left=600,top=0&#34;); &lt;/script&gt; </code></pre> <p>上面的代码将打开窗口<pre><code>test2.html</code></pre>,其中包含以下代码:</p> <pre><code>&lt;script&gt; opener.window.janela.close = null; &lt;/script&gt; </code></pre> <p>现在,在窗口 <pre><code>test1.html</code></pre> 上,如果我尝试关闭刚刚使用 <pre><code>janela.close()</code></pre> 打开的窗口,我将无法这样做。</p> <p>我知道在 <pre><code>noopener</code></pre> 方法中使用 <pre><code>window.open</code></pre> 会阻止 <pre><code>test2.html</code></pre> 访问 <pre><code>test1.html</code></pre> 但是它也会阻止我在 <pre><code>test1.html</code></pre> 关闭 <pre><code>test2.html</code></pre>。</p> <p>那么我怎样才能可靠地打开 <pre><code>window</code></pre> 并能够在将来自信地关闭它?</p> <p><strong>根据@mplungjan</strong></p>进行编辑 <p>在@mplungjan的帮助下,我做到了:</p> <pre><code>myClose = window.close; janela = window.open(&#34;https://a2eestrutural.eng.br/?fdfk&#34;,&#34;_blank&#34;,&#34;width=1000,height=400,left=600,top=20&#34;); janela.myClose = window.myClose; </code></pre> <p>窗口打开后,我尝试执行<pre><code>janela.myClose();</code></pre>并收到此错误消息:</p> <pre><code>An attempt was made to break through the security policy of the user agent. </code></pre> <p>知道我该如何继续吗?</p> </question> <answer tick="false" vote="0"> <p>为什么要有这个代码?如果您可以控制打开的内容...</p> <p>无论如何,请在打开窗口的脚本之前尝试此操作</p> <pre><code>const myClose = window.close; const janela = window.open(&#34;http://localhost/test2.html&#34;,&#34;_blank&#34;,&#34;width=1000,height=400,left=600,top=0&#34;); .... janela.myClose() </code></pre> </answer> </body></html>


© www.soinside.com 2019 - 2024. All rights reserved.