8000 Test Http Authentication · Issue #8005 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content
8000

Test Http Authentication #8005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lecneri opened this issue Jun 7, 2017 · 3 comments
Closed

Test Http Authentication #8005

lecneri opened this issue Jun 7, 2017 · 3 comments
Labels
hasPR A Pull Request has already been submitted for this issue. Security Testing

Comments

@lecneri
Copy link
lecneri commented Jun 7, 2017

Hi,

The docs in http://symfony.com/doc/current/testing/http_authentication.html
says too add the following content to config_test.yml

security:
    firewalls:
        your_firewall_name:
            http_basic: ~

Although when you do that and try to test you run into this error:

Symfony\Component\Config\Definition\Exception\InvalidConfigurationException: You are not allowed to define new elements for path "security.firewalls". Please define all elements for this path in one config file.

This is because config.yml imports security.yml that already has security.firewalls defined.
Btw, anyone know a good way to make this http authentication test work?

@lecneri
Copy link
Author
lecneri commented Jun 9, 2017

I tried to search about the exception, and it's reported and closed on symfony's repository because it's a well known behavior.

symfony/symfony#16517

This means documentation is telling us to something that will make us run into an error.

@xelaris
Copy link
Contributor
xelaris commented Jun 14, 2017

It's crucial to use the same firewall name which is used in security.yml (e.g. main instead of your_firewall_name). So you won't define a new element (a new firewall) under security.firewalls, but alter the original firewall configuration.

Maybe the documentation could be more explicit about this.

@lecneri
Copy link
Author
lecneri commented Jun 19, 2017

@xelaris thank you. Indeed it needed same name.
I was thinking that I should not overwrite the firewall because the authentication method was already defined, so I thought that I had to create a new one for testing purpose.
For me it's fine now. Should we close?

@xabbuh xabbuh added hasPR A Pull Request has already been submitted for this issue. Security Testing labels Jun 20, 2017
xabbuh added a commit that referenced this issue Jun 22, 2017
…s, javiereguiluz)

This PR was merged into the 2.7 branch.

Discussion
----------

Clearify setup of basic auth for test environment

Fixes #8005

Commits
-------

5f7c5f6 Minor reword
56488ed Clearify setup of basic auth for test environment
@xabbuh xabbuh closed this as completed Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Security Testing
Projects
None yet
Development

No branches or pull requests

3 participants
0