Closed mgwebinc closed 1 year ago
Hey @mgwebinc !
What are you referencing with this issue? If you're talking about our docs - we show both ways: the legacy Guard way for BC and the new way here: https://github.com/knpuniversity/oauth2-client-bundle#authenticating-with-the-new-symfony-authenticator
Can we close this issue?
Hi, In the document in Authenticating with Guard part the example starts with
namespace App\Security;
use App\Entity\User; // your user entity
use Doctrine\ORM\EntityManagerInterface;
use KnpU\OAuth2ClientBundle\Security\Authenticator\SocialAuthenticator;
...
class MyFacebookAuthenticator extends SocialAuthenticator
{
but SocialAuthenticator extends AbstractGuardAuthenticator as you can see
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
abstract class SocialAuthenticator extends AbstractGuardAuthenticator
{
and AbstractGuardAuthenticator seems to be deprecated and I have this error :
Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#5973
#message: """
Attempted to load class "AbstractGuardAuthenticator" from namespace "Symfony\Component\Security\Guard".\n
Did you forget a "use" statement for another namespace?
"""
I am using PHP 8.2.4 and Symfony 6.2
Hey @mrbinr ,
Yes, Guard is deprecated and left in the docs only for legacy projects. Please, follow the new way with: https://github.com/knpuniversity/oauth2-client-bundle#authenticating-with-the-new-symfony-authenticator in case you're using a newer Symfony version
AbstractAuthenticator is now part of http security.