hslavich / OneloginSamlBundle

OneLogin SAML Bundle for Symfony
MIT License
149 stars 94 forks source link

Error in definition of provider in 1.6.2 #175

Closed rmdefi closed 3 years ago

rmdefi commented 3 years ago

Using version 1.6.2 (with symfony 4.4.25), running cache:clear gives me an error:

In Definition.php line 292:

  [Symfony\Component\DependencyInjection\Exception\OutOfBoundsException]                                
  Service "security.authentication.provider.saml.dashboard": The index "1" is not in the range [0, 0].  

This related to the change, in version 1.6.0, in Hslavich\OneloginSamlBundle\DependencyInjection\Security\Factory\SamlFactory::createAuthProvider which changed an addArgument to a replaceArgument. But in Resources/config/services.yml, hslavich_onelogin_saml.saml_provider only defines one argument.

So, I suppose either the definition in services.yml should define a second argument (to be replaced), or createAuthProvider should be changed back to using addArgument?

rmdefi commented 3 years ago

I have a workaround, to redefine (in my own services) the service with two arguments:

services:
    class: Hslavich\OneloginSamlBundle\Security\Authentication\Provider\SamlProvider
        arguments: ["",""]
alafon commented 3 years ago

Hi and thanks for your hard work.

Confirming the issue and the workaround :+1:

a-menshchikov commented 3 years ago

@rmdefi thank you! Test fixed 1.x please. If all right I will release it and close this issue.

rmdefi commented 3 years ago

Yes, I loaded current 1.x-dev with composer and it solves the problem, thank you.