You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用SendGrid结合自定义策略发送带OTP的HTML时控制台报错

Azure AD B2C 集成SendGrid发送MFA OTP时遭遇CSP阻塞导致页面无响应

我正在Azure AD B2C的MFA流程中集成SendGrid发送OTP验证码,已完成官方文档中声明转换等全部配置步骤。

当前遇到的问题:

  • 技术栈为前端Vue/Nuxt 3+、后端ASP.NET Core MVC,访问localhost:3000测试登录触发OTP流程时,页面完全无响应
  • 浏览器控制台输出如下CSP错误:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'strict-dynamic' 'self' 'nonce-c7cJJBRlOHvhhttGtKagEg==' 'report-sample'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

  • 错误定位到authorize文件的第一行,错误截图:
    错误截图

补充说明:用Postman直接调用相关接口可以正常发送邮件,但在当前技术栈的登录流程中无法触发OTP发送,已经排查近一周,想了解是否有其他开发者遇到过同类问题,或者有可行的解决方向?

内容的提问来源于stack exchange,提问作者Quoter

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 23:51:04