1

i am new to Symfony2 and need to create a Custom Authentication Provider, so i read the How to create a custom Authentication Provider. I created all classes, also the Custom User Provider from How to create a custom User Provider but i am getting this Exception:

RuntimeException: The parent definition "wsse.security.authentication.provider" defined for definition "security.authentication.provider.wsse.wsse_secured" does not exist.

I copy/pasted all classes and configuration parts from the Cookbook and only changed my Bundlename.

4
  • For WSSE, you might want to look at github.com/mjhapp/MjhWsseBundle which is the Symfony2 cookbook article wrapped up in a bundle. Commented Jun 29, 2012 at 8:33
  • 1
    I tried to move the definition of the services to app/config/security.yml and it works. I dont know why its not working if i define them in the bundle/Resources/config/services.yml as the tutorial says. Commented Jun 29, 2012 at 9:25
  • Is your DIC loading your services.yml in your bundle? Commented Jun 29, 2012 at 17:17
  • 1
    Yeah actualy i didn't had the Bundle*Extension Class which loads my services.yml... Commented Jul 13, 2012 at 12:08

2 Answers 2

5

As mentioned in comments above - for those having the same problem I think Reza Sanaie's answer not the intended solution. You should better check if you have a file /DependencieInjection/Security/{Vendor}{YourBundleName}Extension.php in your Bundle. The file needs to have the correct filename and the class will be executed by symfony2 kernel automatically. If you have a look into the class-code of this file you will see something like

$loader->load('services.yml');

This will load your services.yml and the problem should be solved.

Sign up to request clarification or add additional context in comments.

Comments

5

You need to update your config.yml to include in the services config from your bundle in your main application

# app/config/config.yml
imports:
    - { resource: @AcmeHelloBundle/Resources/config/services.yml }

3 Comments

OP should have accepted this as correct - nice quick answer that the manual is super vague about. Mentions using the correct import syntax, but does not show what this correct syntax is; answer works like a charm.
Sorry, should have answered my question... i just mentioned it as a comment above. The right answer is below from chsymann or in a comment by me under the question. The problem was the missing {YourBundleName}Extension.php file
Good call, that is definitely the correct answer if you left off the Extension class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.