Hi, I have a problem with admin and users and I got confused with all that. I've already installed sonata admin(with fos user) and there everything works fine.
But i have a problem with facebook bundle on frontend.
When i click the login button and fill the facebook requirements the button is changing to logout, but when i change the page it changes back to login again.
I think there is a problem with my configuration ;/
Below i present my configuration.
My security:
security:
providers:
my_fos_facebook_provider:
id: my.facebook.user
fos_userbundle:
id: fos_user.user_manager
encoders:
"FOS\UserBundle\Model\UserInterface": sha512
firewalls:
admin:
switch_user: true
context: user
pattern: /admin(.*)
form_login:
provider: fos_userbundle
login_path: /admin/login
use_forward: false
check_path: /admin/login_check
failure_path: null
use_referer: true
default_target_path: /admin/dashboard
logout:
path: /admin/logout
target: /admin/login
anonymous: true
public:
# since anonymous is allowed users will not be forced to login
pattern: .*
fos_facebook:
app_url: "http://apps.facebook.com/krakowforfun/"
server_url: "http://localhost/facebookApp/"
login_path: ^/login
check_path: ^/login_check
default_target_path: /
provider: my_fos_facebook_provider
anonymous: true
logout:
handlers: ["fos_facebook.logout_handler"]
main:
pattern: .*
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: /login_check
failure_path: null
logout: true
anonymous: true
access_control:
# URL of FOSUserBundle which need to be available to anonymous users
- { path: ^/_wdt, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/_profiler, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
# -> custom access control for the admin area of the URL
- { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/login-check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
# -> end
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
# Secured part of the site
# This config requires being logged for the whole site and having the admin role for the admin part.
# Change these rules to adapt them to your needs
- { path: ^/secured/.*, role: [IS_AUTHENTICATED_FULLY] }
- { path: ^/admin, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
SONATA:
- ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT
acl:
connection: default
my config:
fos_user:
db_driver: orm
firewall_name: main
user_class: Acme\UserBundle\Entity\User
fos_facebook:
file: %kernel.root_dir%/../vendor/facebook/src/base_facebook.php
alias: facebook
app_id: "here is my id"
secret: "here is my secret"
cookie: true
permissions: [email, user_birthday, user_location]
Hi, I have a problem with admin and users and I got confused with all that. I've already installed sonata admin(with fos user) and there everything works fine.
But i have a problem with facebook bundle on frontend.
My website: http://sgnx.lh.pl/web/app_dev.php
When i click the login button and fill the facebook requirements the button is changing to logout, but when i change the page it changes back to login again. I think there is a problem with my configuration ;/
Below i present my configuration.
My security:
my config:
my routing:
If anyone can help me i will appreciate it.