0
與Symfony的(與FOSUserbundle)開發在Windows 10FOSUserBundle的登錄表單的路線不從WampServer網絡地址
我必須通過本地網絡IP(不是計算機的本地IP這將是127.0訪問我的應用程序中找到。 0.1),因爲在註冊/認證過程中的某個時刻,必須調用外部(國家)認證服務。
我的應用程序工作正常,當我使用http://[my_network_ip]:81/以及http://127.0.0.1:81/,除了FOSUserBundle的登錄表單。
:使用 http://127.0.0.1:81/login在使用 http://[my_network_ip]:81/login的時候,我得到未找到路線 「GET /登錄/」
一些配置例外的頁面顯示,但
security.yml
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
providers:
in_memory:
memory: ~
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
logout: ~
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
#http_basic: ~
# https://symfony.com/doc/current/security/form_login_setup.html
form_login: ~
#login_path: fos_user_security_login
#check_path: fos_user_security_check
#provider: fos_userbundle
#csrf_token_generator: security.csrf.token_manager
#default_target_path:/
encoders:
AppBundle\Entity\FasUser: bcrypt
的routing.yml
app:
resource: '@AppBundle/Controller/'
type: annotation
singlesingon_view:
path: '/authentication/singlesignon/'
defaults: { _controller: AppBundle:AuthenticationSingleSignOn:view }
singlesingout_view:
path: '/authentication/singlesignout/'
defaults: { _controller: AppBundle:AuthenticationSingleSignOut:view }
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
app_dev.php
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'],['[my_network_ip]','127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
我怎樣才能登錄表單與http://[my_network_ip]:81/login
您可以檢查'php應用程序/控制檯調試:路由器' –
由於該路由工作在本地,我不指望在這裏發現任何問題。我剛剛檢查過,但你期望它顯示什麼? – TTT