伙计们!
我目前正在做一个基于Symfony 2.8和一些Sonata-Project捆绑包的项目。目标是实现双因素身份验证(也称为两步验证)。我看到Sonata-Project有一个用于实现这些功能的包,并安装了它。然后根据sonata's documentation配置app/config/config.yml文件,但当我尝试从登录表单登录到仪表板时,没有任何进一步的障碍(没有双因素身份验证提示)。在这里,在stackoverflow.com上,我已经看到了一些(不完全)与我的问题相关的答案,它们建议运行php app/console sonata:user:two-step-verification *ADMIN_USER_NAME*。我试图在我的终端上运行这个命令,但是抛出了这个异常:
[Symfony\Component\Debug\Exception\UndefinedMethodException]
Attempted to call an undefined method named "getTwoStepVerificationCode" of class
"Application\Sonata\UserBundle\Entity\User".这里似乎出了什么问题?为什么这样的方法不存在?如何解决此问题?
附言:我尝试将这个Google-Authenticator包与Soanata-Project的UserBundle作为it is "a feature" (if I may call it such) of the latter一起使用。
发布于 2019-02-13 14:08:22
您的应用程序是否正确地扩展了Sonata\UserBundle\Entity\BaseUser?因为如果不是这样,你就会遇到这个问题。检查您的类Application\Sonata\UserBundle\Entity\User。
https://stackoverflow.com/questions/54634449
复制相似问题