简体   繁体   English

Sonata-Project的Google Authenticator:来自Application \\ Sonata \\ UserBundle \\ Entity \\ User的未定义方法“ getTwoStepVerificationCode”

[英]Sonata-Project's Google Authenticator: Undefined Method “getTwoStepVerificationCode” from Application\Sonata\UserBundle\Entity\User

guys! 伙计们!

I am currently working on a project built on Symfony 2.8 and a few Sonata-Project bundles. 我目前正在基于Symfony 2.8和一些Sonata-Project捆绑包构建项目。 The goal is to achieve Two-Factor Authentication (aka Two-Step Verification). 目标是实现两要素身份验证(又称为两步验证)。 I saw that Sonata-Project has a package for implementing such functionality and installed it. 我看到Sonata-Project有一个用于实现这种功能的软件包,并安装了它。 Then configured the app/config/config.yml file according to sonata's documentation , but when I try to log into my Dashboard from the login form, I do that without any further obstacles (no 2-Factor Authentication Prompt). 然后根据app/config/config.yml 的文档配置app/config/config.yml文件,但是当我尝试从登录表单登录到仪表板时,我这样做没有任何其他障碍(没有2要素身份验证提示)。 Here, on stackoverflow.com, I've seen a few answers, (not-fully) related to my question, that suggest running php app/console sonata:user:two-step-verification *ADMIN_USER_NAME* . 在这里,在stackoverflow.com上,我看到了一些答案(并非完全与我的问题有关),这些答案建议运行php app/console sonata:user:two-step-verification *ADMIN_USER_NAME* I've tried to run this command in my terminal, but got this exception thrown: 我尝试在终端中运行此命令,但引发了此异常:

[Symfony\Component\Debug\Exception\UndefinedMethodException]
Attempted to call an undefined method named "getTwoStepVerificationCode" of class 
"Application\Sonata\UserBundle\Entity\User".

What seems to be the problem here? 这里似乎是什么问题? Why such method doesn't exist? 为什么这种方法不存在? How can I resolve this issue? 我该如何解决这个问题?

PS: I try to use this Google-Authenticator package in conjunction with Soanata-Project's UserBundle as it is "a feature" (if I may call it such) of the latter . PS:我尝试将此Google-Authenticator软件包与Soanata-Project的UserBundle结合使用,因为它是后者的“一项功能”(如果可以这样称呼)

Does your application properly extend Sonata\\UserBundle\\Entity\\BaseUser ? 您的应用程序是否正确扩展了Sonata\\UserBundle\\Entity\\BaseUser Because if not you will have this issue. 因为如果没有,您将遇到这个问题。 Check your class Application\\Sonata\\UserBundle\\Entity\\User . 检查您的类Application\\Sonata\\UserBundle\\Entity\\User

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Sonata-project在Symfony 2中上传文件 - File uploads in Symfony 2 using sonata-project 扩展具有更多表单字段的Sonata用户捆绑包,获取无法加载类型“ Application \\ Sonata \\ UserBundle \\ Form \\ RegistrationType” - extending sonata user bundle with more form fields, get Could not load type “Application\Sonata\UserBundle\Form\RegistrationType” Symfony2 Sonata-Project管理员软件包-如何列出自定义数据而不是orm实体 - Symfony2 Sonata-project admin bundle - how to list custom data instead of orm entity 需要帮助在Composer中清理/组织Sonata-Project依赖项 - Need help to clean/organize sonata-project dependencies in composer 在 sonata-project/block-bundle 4.0 中包含资产 - Including assets in sonata-project/block-bundle 4.0 奏鸣曲分类捆绑::未定义的索引:供应商/sonata-project/doctrine-orm-admin-bundle/Guesser/FilterTypeGuesser.php中的父项 - Sonata Classification Bundle :: Undefined index: parent in vendor/sonata-project/doctrine-orm-admin-bundle/Guesser/FilterTypeGuesser.php line 64 对象“ Sonata \\ UserBundle \\ Twig \\ GlobalVariables”的方法“ defaultAvatar”不存在? - Method “defaultAvatar” for object “Sonata\UserBundle\Twig\GlobalVariables” does not exist? Symfony2奏鸣曲用户捆绑 - Symfony2 Sonata Userbundle 没有用户实体的Sonata密码 - Sonata password without User entity 从Sonata UserBundle覆盖用户 - Override Users Form Sonata UserBundle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM