使用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
相关产品推荐
相关产品推荐

