問題:FOSFacebookBundle休息「記住我」 FOSUserBundle的
我們一直在使用FOSUserBundle爲Symfony2的,和一切工作正常,包括「記住我」。
我們最近推出FOSFacebookBundle。此後,「正常」登錄的「記住我」被打破。
例如:
當我們只使用FosUSer如果用戶通過登錄形式登錄,並保持,對於爲例5小時沒有活動,點擊任何鏈接都繼續工作後,與用戶登錄和識別。
當我們激活FosFacebook,同一用戶也經由登錄形式登錄(未來自Facebook)和停留時間不活動。點擊任何鏈接後,他被重定向到登錄表單,並在已經再次進入其密碼時,再次被重定向到目標URL。
如果我們從配置停用FosFacebook,「記住我」爲FosUser再次工作正常。
問:
是不是正常的,FosFacebook打破了FosUser 「自然」 還記得我的用戶沒有使用FB?
如果要正常工作...任何人都可以看到,如果我們已經在我們的配置文件進行錯誤?
配置文件:
config.yml
# FOS User
fos_user:
db_driver: %database_method% # other valid values are 'mongodb', 'couchdb'
firewall_name: main
user_class: Common\ODMBundle\Document\User
from_email:
address: %fos_email_address%
sender_name: %fos_sender_name%
profile:
form:
type: fos_user_profile
handler: fos_user.profile.form.handler.default
name: fos_user_profile_form
validation_groups: [Profile]
change_password:
form:
type: fos_user_change_password
handler: fos_user.change_password.form.handler.default
name: fos_user_change_password_form
validation_groups: [ChangePassword]
registration:
confirmation:
enabled: true
template: FOSUserBundle:Registration:email.txt.twig
form:
type: fos_user_registration
handler: fos_user.registration.form.handler.default
name: fos_user_registration_form
validation_groups: [Registration]
resetting:
token_ttl: 600
email:
template: FOSUserBundle:Resetting:email.txt.twig
form:
type: fos_user_resetting
handler: fos_user.resetting.form.handler.default
name: fos_user_resetting_form
validation_groups: [ResetPassword]
# FOS facebook
fos_facebook:
file: %kernel.root_dir%/../vendor/facebook/src/base_facebook.php
alias: facebook
app_id: xxxxxxxxxxxxxxx
secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
cookie: true
permissions: [email, user_birthday]
security.yml
security:
providers:
fos_userbundle:
id: fos_user.user_manager
my_fos_facebook_provider:
id: my.facebook.user
factories:
- "%kernel.root_dir%/../vendor/bundles/FOS/FacebookBundle/Resources/config/security_factories.xml"
firewalls:
main:
pattern: ^/
fos_facebook:
check_path: /login_checkFB
default_target_path: /user/
provider: my_fos_facebook_provider
form_login:
provider: fos_userbundle
default_target_path: /user/
logout: true
anonymous: true
switch_user: true
remember_me:
key: aSecretKey
lifetime: 604800
path: /
domain: ~
access_control:
#- { path: ^/.*$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/private/, role: ROLE_USER }
- { path: ^/user/, role: ROLE_USER }
- { path: ^/admin/, role: ROLE_ADMIN }
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
哈維蒙特羅,@克里斯托夫 - 範 - cauwenbergh傢伙感謝您的問題和答案,我有同樣的問題,但即使沒有想到它可以通過Facebook的捆綁造成的 – yefrem