hwi / HWIOAuthBundle

OAuth client integration for Symfony. Supports both OAuth1.0a and OAuth2.
MIT License
2.27k stars 799 forks source link

AuthenticationProviderInterface is deprecated #1783

Closed garak closed 1 year ago

garak commented 3 years ago
Q A
Bug? no
New Feature? yes
Support question? no
Version 2.x

Similarly to issue #1641, the AuthenticationProviderInterface was deprecated in Symfony 5.3. OAuthProvider is currently implementing it.

stloyd commented 3 years ago

Please share your configuration & more details cause this should be fixed already, that OAuthProvider IIRC should not be called in new auth with enable_authenticator_manager: true.

garak commented 3 years ago

Here it is:

security:
  enable_authenticator_manager: true
  firewalls:
    my_firewall:
      pattern: ^/
      oauth:
        login_path: /login
        failure_path: /login
        oauth_user_provider:
          service: My\Service\Implementing\OAuthAwareUserProviderInterface
        provider: My\Service\Implementing\OAuthAwareUserProviderInterface
      logout: ~
adrienfr commented 3 years ago

Same deprecation warning here :

1x: The "HWI\Bundle\OAuthBundle\Security\Core\Authentication\Provider\OAuthProvider" class implements "Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface" that is deprecated since Symfony 5.3, use the new authenticator system instead.

with security.enable_authenticator_manager: true and a security.firewalls.main.oauth.oauth_user_provider.service implementing OAuthAwareUserProviderInterface.

bin/console debug:container hwi_oauth
Information for Service "hwi_oauth.authentication.provider.oauth"
=================================================================

 ---------------- ---------------------------------------------------------------------------- 
  Option           Value                                                                       
 ---------------- ---------------------------------------------------------------------------- 
  Service ID       hwi_oauth.authentication.provider.oauth                                     
  Class            HWI\Bundle\OAuthBundle\Security\Core\Authentication\Provider\OAuthProvider  
  Tags             -                                                                           
  Public           no                                                                          
  Synthetic        no                                                                          
  Lazy             no                                                                          
  Shared           yes                                                                         
  Abstract         no                                                                          
  Autowired        no                                                                          
  Autoconfigured   no                                                                          
 ---------------- ----------------------------------------------------------------------------
IonBazan commented 3 years ago

I think this is because hwi_oauth.authentication.provider.oauth is registered here: https://github.com/hwi/HWIOAuthBundle/blob/8af42deee20f76848def1e7f279df8fa42fbc0f8/Resources/config/oauth.xml#L18

even if it's not used (aka new authentication system is used). This may cause an error after upgrading to Symfony 6, when class no longer exists. Maybe we can register this service conditionally?