Unrecognized option "two_factor" under "security.firewalls.main" #196
Comments
The security extension should be loaded automatically, when the bundle is loaded. Please check:
|
//security.yml
// After Adding two_factor code in security.yml i got this error while executing any command in terminal
This is happening again.I want to add two_factor in security.yml so i can use |
Then I really don't know why it doesn't accept the key in the firewall configuration. This line is being executed, right? |
Is there any other way to redirect by default after successful authentication? |
I've just recognized the obvious problem. You're still using bundle version 2.x and reading documentation from 3.x. This obviously doesn't work very well together. I'd highly recommend to upgrade your two-factor-bundle to 3.x. You're running on Symfony 3.4, so that will work. Have a look at the upgrade instructions, it's quite some work since the bundle has been completely rewritten, but it's worth it. |
How to upgrade to 3.x ,i have check the link upgrade instruction , |
You upgrade the bundle to version 3.x (use latest minor release) and then follow the upgrade instructions to get your integration with the bundle updated. That potentially means updating configuration, renaming methods, updating method signatures, replacing interfaces with their new counterparts. Depends on how many customization features of the bundle you're using. If you're not using that many customization features, it's probably easier to just reinstall the bundle. |
I have upgrade the version and update many code as per instruction.
It is giving error for all of the below method in my user.php entity
It is asking for compatible,,can you help. |
As I said, you need to update the method signatures of your integration. In this case, the method |
can you please update this code according to signature. `// ....Two-factor Authentication.............
|
You copy the method signatures from the interface that you've implemented, which is https://github.com/scheb/two-factor-bundle/blob/master/Model/Email/TwoFactorInterface.php
|
Thank you very much . |
Are you using the standard template for the authentication form? Or did you customize it? |
i was using old template sorry,my fault,now i have check the standard template and i have one more question when user redirect to this path what should i do ,? |
You need to register a route named "2fa_login_check", as seen here: https://github.com/scheb/two-factor-bundle/blob/master/Resources/doc/installation.md#step-3-define-routes |
Now getting this error after submit the two_factor form |
I have checked that there is no controller for this in latest version,what you think about this.? |
It doesn't need a controller, the route is automatically managed by
If all of this looks fine, debug into the code. When you POST against that route, check if you enter this method: If so, check if you reach this statement? And does it evaluate to |
it reach to |
So it never enters this line here? https://github.com/scheb/two-factor-bundle/blob/dc3a85e/Security/Http/Firewall/TwoFactorListener.php#L153 |
yes |
here is the warning that i am getting |
I was commented some code when install latest version of your library when i see this code ,now i uncomment that code and the error is showing. |
Di you figure it out? The "Attempted to load class" must be related to you commenting out code. This should not happen if the JWT package was properly installed through Composer. |
Hi @scheb I did the configurations for the budle with my symfony 2.8.49 and its not getting the 2-fa screen after login.
I am using above version. what could be the issue? Thanks |
@connecttosunil scheb/two-factor-bundle version 2 is no longer supported, Also, it has some known security issues. So please upgrade to version 4 or 5. |
@scheb but my Symnfony version is 2.8.49 So which version of ( two-factor-bundle) should I use can you guide please? Also I am following the document this one for Symfony 2.x https://github.com/scheb/two-factor-bundle/blob/2.x/Resources/doc/installation.md And for this I did all steps and in my User entity added the fields also as described in doc, but even the 2-fa screen is not appearing once user logged in. Can you please guide me I am in trouble using the bundle. |
@connecttosunil I'd recommend you upgrade your Symfony version first, because Symfony 2.8 is no longer supported since November 2019. The minimum supported version of scheb/two-factor-bundle version 4 is Symfony 3.4. |
OK I see @scheb but my application is already built with this version, can not upgrade this time. Can you recommend some other solution if you see for this case please? Thanks for your assistance. |
@connecttosunil Of course you can upgrade. Upgrade guides from 2.x to 3.4 can be found in the Symfony repository: https://github.com/symfony/symfony/tree/3.4 => See: UPGRADE-3.0.md ... UPGRADE-3.4.md I'm afraid, I cannot help you with the problem, when you're using such an old version of the bundle. |
I am getting this error when trying to use this library in symfony 3.4 and the library version is 2.14
here is the code
//security.yml
security:
and i just add the this code in AppKernel.php
// AppKernal.php
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
The text was updated successfully, but these errors were encountered: