Tuesday, 15 March 2011

php - HWIOauthBundle not redirecting to desired path after login -



php - HWIOauthBundle not redirecting to desired path after login -

i did per documentation , resources internet. not redirecting user default_target_path specified

here security.yml

security: encoders: fos\userbundle\model\userinterface: sha512 role_hierarchy: role_admin: role_user role_super_admin: [role_user, role_admin, role_allowed_to_switch] providers: fos_userbundle: id: fos_user.user_provider.username firewalls: secured_area: pattern: ^/user anonymous: ~ oauth: remember_me: true resource_owners: facebook: "/user/login/check-facebook" # google: "/login/check-google" # my_custom_provider: "/login/check-custom" login_path: /user/login check_path: /user/connect use_forward: false failure_path: /user/login default_target_path: /user/like provider: fos_userbundle oauth_user_provider: # oauth: ~ service: hwi_oauth.user.provider.fosub_bridge logout: true access_control: - { path: ^/user/login, roles: is_authenticated_anonymously } - { path: ^/user/connect, roles: is_authenticated_anonymously } - { path: ^/user(.*), roles: role_user }

and config.yml is

hwi_oauth: # name of firewall in bundle active, setting must set firewall_name: secured_area connect: confirmation: true resource_owners: facebook: type: facebook client_id: id client_secret: secret scope: "email user_birthday" paths: email: email birthday: user_birthday fosub: # seek 30 times check if username available (foo, foo1, foo2 etc) username_iterations: 30 # mapping between resource owners (see below) , properties properties: facebook: fbid fos_user: db_driver: orm # other valid values 'mongodb', 'couchdb' , 'propel' firewall_name: main user_class: auth\userbundle\entity\user

at end redirect me ,

http://myurl/user/connect/service/facebook?key=1415715954

and displays output text header.success

what should do?

there typo there, simple mistake. @stivenllup suggested in comments,

i changed

access_control: - { path: ^/user/login, roles: is_authenticated_anonymously } - { path: ^/user/connect, roles: is_authenticated_anonymously } - { path: ^/user(.*), roles: role_user } # changed

to

access_control: - { path: ^/user/login, roles: is_authenticated_anonymously } - { path: ^/user/connect, roles: is_authenticated_anonymously } - { path: ^/user/, roles: role_user } #

if hwioauthbundle service can't find right path redirect /user/like problem occurs

also if there error in controller of specified path proper redirection not work

adding right path in access_control solved it.

php symfony2 fosuserbundle facebook-oauth hwioauthbundle

No comments:

Post a Comment