Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Deprecation about provider for custom_authenticators #44362

Copy link
Copy link
Closed
@aless673

Description

@aless673
Issue body actions

Hi, i have multiple authenticators written with the new Auth manager system, here a part of my security.yaml config

        main:
            lazy: true
            form_login:
                provider: app_user_provider
                login_path: app_login
                check_path: app_login
                enable_csrf: true
                default_target_path: auth_success_redirect
            custom_authenticators:
                - App\Security\Authenticator\AuthAuthenticator
            entry_point: form_login
            remember_me:
                secret: '%env(APP_SECRET)%'
                always_remember_me: true
                secure: true
            logout:
                path: app_logout

I have deprecation since symfony 5.4

Since symfony/security-bundle 5.4: Not configuring explicitly the provider for the "custom_authenticators" listener on "main" firewall is deprecated because it's ambiguous as there is more than one registered provider

I don't have provider for this firewall, i only have the authenticate function in the authenticator

    public function authenticate(Request $request): Passport
    {
        $client = $this->getClient();
        $accessToken = $this->fetchAccessToken($client);

        return new SelfValidatingPassport(
            new UserBadge($accessToken, function() use ($accessToken, $client) {
                $authUser = $client->fetchUserFromToken($accessToken);
                $user = $this->userRepository->findOneByAuthId($authUser->getId()) ?: (new User());
                $this->authManager->synchroUserData($user, $authUser->getId());

                return $user;
            }), [new RememberMeBadge(),],
        );
    }

So what should i do to remove this deprecation ? Is there something i'm missing...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.