Symfony security.yml Unrecognized options "check_path, login_path, provider" under "security.firewalls.secured_area.ldapsecure"

Halfstop

UPDATE I never figured out why the below security.yml file didn't work, but I did learn some stuff along the way that might help someone in the future. I don't know if this 100 percent accurate, but it doesn't appear that the login_path and check_path keys work with route names, you need to use the actual paths (e.g. /login). Also the provider key should be at the same level in the yaml as pattern and anonymous, rather than under ldapsecure as shown below.

I'm getting this error when trying to configure a custom authentication provider using Symfony 2.6.

Unrecognized options "check_path, login_path, provider" under "security.firewalls.secured_area.ldapsecure"

Here's my security.yml

security:
  encoders:
    Symfony\Component\Security\Core\User\User: plaintext
  role_hierarchy:
    ROLE_ADMIN:       ROLE_USER
    ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  providers:
    ldap_provider:
      id: ldap.security.user.provider
  firewalls:
    login_firewall:
      pattern: ^/app/login$
      anonymous: ~
    secured_area:
      pattern: ^/
      ldapsecure:
        check_path: app_security_login_check
        login_path: app_security_login_path
        provider: ldap_provider
    dev:
      pattern:  ^/(_(profiler|wdt)|css|images|js)/
      security: false
  access_control:
    - { path: ^/app/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/, roles: ROLE_USER }

The ldapsecure "factory" class exists and if I change the getKey() method to return someone else, it breaks differently, so the ldapsecure is being recognized. But I can't see why it's not accepting check_path, login_path or provider. If I change ldapsecure to form_login, I don't get the error, it's just not using my authentication provider.

So I feel like I'm missing something, but don't know where to look at this point.

Mark Shehata

In your ldapsecure factory change the body of addConfiguration method to the following:

public function addConfiguration(NodeDefinition $node)
{
    $node
        ->children()
            ->scalarNode('check_path')
                ->isRequired()
            ->end()
            ->scalarNode('login_path')
                ->isRequired()
            ->end()
            ->scalarNode('provider')
                ->isRequired()
            ->end()
        ->end();
    }

This should make it work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Redirection in security.yml

From Dev

Symfony granting path access to multiple roles in security.yml

From Dev

Symfony2 get to the access_control parameters located in the security.yml

From Dev

FOS\RestBundle, "Unrecognized options" on Symfony2

From Dev

Unrecognized options "csrf_provider" under "security.firewalls.form_login"

From Dev

Behat "Unrecognized options"

From Dev

MongoDB YAML "Unrecognized option: security"

From Dev

Unrecognized element 'security'

From Dev

Symfony, security.yml "Unknown Entity namespace alias"

From Dev

Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

From Dev

Symfony2 - Purpose of `anonymous.key` in security.yml

From Dev

Doctrine cache unrecognized options error

From Dev

Symfony2 : Unrecognized option "admin" under "security.providers.in_memory.memory"

From Dev

Cassandra CQLSH Unrecognized COPY FROM options: maxinserterrors

From Dev

Unrecognized option "csrf_token_generator" under "security.firewalls.main.form_login"

From Dev

Symfony doctrine auto_mapping Unrecognized

From Dev

Unrecognized options swift_mailer under sonata_notification.consumers error

From Dev

How to configure security.yml

From Dev

MongoDB YAML "Unrecognized option: security"

From Dev

Unrecognized options "suites" under "behat"

From Dev

How can options be parsed in a Bash script, leaving unrecognized options after the "--"?

From Dev

More than one firewall at Symfony2 project security.yml, how to deal with pattern?

From Dev

Symfony, security.yml "Unknown Entity namespace alias"

From Dev

Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

From Dev

Symfony3 Login form : how to parametrize firewall in security.yml?

From Dev

symfony how to use custom validators.yml file under MyBundle\Resources\translations

From Dev

Symfony 3 - Ckeditor bundle : Unrecognized options "template, template_parameters"

From Dev

Unrecognized options "scheme, cluster, url" under "lopi_pusher"

From Dev

Symfony unrecognized provider property

Related Related

  1. 1

    Redirection in security.yml

  2. 2

    Symfony granting path access to multiple roles in security.yml

  3. 3

    Symfony2 get to the access_control parameters located in the security.yml

  4. 4

    FOS\RestBundle, "Unrecognized options" on Symfony2

  5. 5

    Unrecognized options "csrf_provider" under "security.firewalls.form_login"

  6. 6

    Behat "Unrecognized options"

  7. 7

    MongoDB YAML "Unrecognized option: security"

  8. 8

    Unrecognized element 'security'

  9. 9

    Symfony, security.yml "Unknown Entity namespace alias"

  10. 10

    Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

  11. 11

    Symfony2 - Purpose of `anonymous.key` in security.yml

  12. 12

    Doctrine cache unrecognized options error

  13. 13

    Symfony2 : Unrecognized option "admin" under "security.providers.in_memory.memory"

  14. 14

    Cassandra CQLSH Unrecognized COPY FROM options: maxinserterrors

  15. 15

    Unrecognized option "csrf_token_generator" under "security.firewalls.main.form_login"

  16. 16

    Symfony doctrine auto_mapping Unrecognized

  17. 17

    Unrecognized options swift_mailer under sonata_notification.consumers error

  18. 18

    How to configure security.yml

  19. 19

    MongoDB YAML "Unrecognized option: security"

  20. 20

    Unrecognized options "suites" under "behat"

  21. 21

    How can options be parsed in a Bash script, leaving unrecognized options after the "--"?

  22. 22

    More than one firewall at Symfony2 project security.yml, how to deal with pattern?

  23. 23

    Symfony, security.yml "Unknown Entity namespace alias"

  24. 24

    Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

  25. 25

    Symfony3 Login form : how to parametrize firewall in security.yml?

  26. 26

    symfony how to use custom validators.yml file under MyBundle\Resources\translations

  27. 27

    Symfony 3 - Ckeditor bundle : Unrecognized options "template, template_parameters"

  28. 28

    Unrecognized options "scheme, cluster, url" under "lopi_pusher"

  29. 29

    Symfony unrecognized provider property

HotTag

Archive