symfony2 - Integration of HWIOAuthBundle with FosUserbundle configuration issue -
i have followed article , implemented oauth2 github, after successful authentication, getting below error.
unable find controller path "/secure_area/login/check-github". maybe forgot add together matching route in routing configuration?
config.yml
hwi_oauth: # name of firewall in bundle active, setting must set firewall_name: secure_area connect: confirmation: true #account_connector: hwi_oauth.user.provider.fosub_bridge #registration_form_handler: hwi_oauth.registration.form.handler.fosub_bridge #registration_form: fos_user.registration.form resource_owners: github: type: github client_id: a8b7e3e35e46271d10a5 client_secret: 6abca3ded9a19d9e2bf52b42f017d23a745bd540 scope: "user:email" fosub: # seek 30 times check if username available (foo, foo1, foo2 etc) username_iterations: 30 # mapping between resource owners (see below) , properties properties: github: githubid
security.yml
# app/config/security.yml security: encoders: fos\userbundle\model\userinterface: sha512 role_hierarchy: role_admin: role_user role_super_admin: role_admin providers: fos_userbundle: id: fos_user.user_provider.username firewalls: main: pattern: ^/ form_login: provider: fos_userbundle csrf_provider: form.csrf_provider logout: true anonymous: true secure_area: pattern: ^/secure_area oauth: failure_path: /secure_area/connect login_path: /secure_area/connect check_path: /secure_area/connect provider: fos_userbundle resource_owners: github: "/secure_area/login/check-github" oauth_user_provider: service: hwi_oauth.user.provider.fosub_bridge anonymous: true logout: path: /secure_area/logout target: /secure_area/connect #where go after logout access_control: - { path: ^/login$, role: is_authenticated_anonymously } - { path: ^/register, role: is_authenticated_anonymously } - { path: ^/resetting, role: is_authenticated_anonymously } - { path: ^/admin/, role: role_admin } - { path: ^/secure_area/login, roles: is_authenticated_anonymously } - { path: ^/secure_area/connect, roles: is_authenticated_anonymously } - { path: ^/secure_area, roles: role_user }
what have in routing configuration. have route setup hwi_github_login?
another route named hwi_github_login added same callback url given during creation of github application. url intercepted firewall check authentication.
your routing.yml should have:
hwi_oauth_redirect: resource: "@hwioauthbundle/resources/config/routing/redirect.xml" prefix: /secure_area/connect hwi_oauth_login: resource: "@hwioauthbundle/resources/config/routing/login.xml" prefix: /secure_area/connect hwi_oauth_connect: resource: "@hwioauthbundle/resources/config/routing/connect.xml" prefix: /secure_area/connect hwi_github_login: pattern: /secure_area/login/check-github
symfony2 fosuserbundle hwioauthbundle symfony-2.5
No comments:
Post a Comment