Home > Backend Development > PHP Tutorial > security 配置后,没有进行验证

security 配置后,没有进行验证

WBOY
Release: 2016-06-06 20:48:49
Original
1047 people have browsed it

<code>access_control:
           - { path: ^/site/admin/*, roles: ROLE_ADMIN }

                                    firewalls:
  config.yml               | 17         dev:
  config_dev.yml           | 18             pattern:  ^/(_(profiler|wdt)|css|images|js)/
  config_prod.yml          | 19             security: false
  config_test.yml          | 20 
  parameters.yml           | 21         login:
  parameters.yml.dist      | 22             pattern:  ^/site/admin/login$
  routing.yml              | 23             security: false
  routing_dev.yml          | 24 
  security.yml             | 25         secured_area:
                                        pattern:    ^/site/admin/
                                            form_login:
AppCache.php               | 28                 check_path: _admin_check
AppKernel.php              | 29                 login_path: _admin_login
autoload.php               | 30             logout: 
bootstrap.php.cache        | 31                 path:   _admin_logout
check.php                  | 32                 target: _site                                                                                                      
console*                   | 33             #anonymous: ~                                                                                                          
phpunit.xml.dist           | 34             #http_basic:                                                                                                           
SymfonyRequirements.php    | 35             #    realm: "Secured Demo Area"
</code>
Copy after login
Copy after login

我访问http://url/site/admin 没有跳转到指定的login页面....

回复内容:

<code>access_control:
           - { path: ^/site/admin/*, roles: ROLE_ADMIN }

                                    firewalls:
  config.yml               | 17         dev:
  config_dev.yml           | 18             pattern:  ^/(_(profiler|wdt)|css|images|js)/
  config_prod.yml          | 19             security: false
  config_test.yml          | 20 
  parameters.yml           | 21         login:
  parameters.yml.dist      | 22             pattern:  ^/site/admin/login$
  routing.yml              | 23             security: false
  routing_dev.yml          | 24 
  security.yml             | 25         secured_area:
                                        pattern:    ^/site/admin/
                                            form_login:
AppCache.php               | 28                 check_path: _admin_check
AppKernel.php              | 29                 login_path: _admin_login
autoload.php               | 30             logout: 
bootstrap.php.cache        | 31                 path:   _admin_logout
check.php                  | 32                 target: _site                                                                                                      
console*                   | 33             #anonymous: ~                                                                                                          
phpunit.xml.dist           | 34             #http_basic:                                                                                                           
SymfonyRequirements.php    | 35             #    realm: "Secured Demo Area"
</code>
Copy after login
Copy after login

我访问http://url/site/admin 没有跳转到指定的login页面....

http://url/site/admin没有被firewall的pattern(^/site/admin/)包含。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template