From 609394f3eb2f1f6a76bd2a4db25631d05447deb8 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Tue, 12 Jun 2018 08:13:16 +0300 Subject: [PATCH 1/9] add hwi/oauth-bundle --- hwi/oauth-bundle/0.6/config/manifest.json | 9 ++++++ .../0.6/config/packages/hwi_oauth.yaml | 29 +++++++++++++++++++ .../0.6/config/routes/hwi_oauth_routing.yaml | 11 +++++++ hwi/oauth-bundle/0.6/post-install.txt | 20 +++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 hwi/oauth-bundle/0.6/config/manifest.json create mode 100644 hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml create mode 100644 hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml create mode 100644 hwi/oauth-bundle/0.6/post-install.txt diff --git a/hwi/oauth-bundle/0.6/config/manifest.json b/hwi/oauth-bundle/0.6/config/manifest.json new file mode 100644 index 00000000..641ea1d7 --- /dev/null +++ b/hwi/oauth-bundle/0.6/config/manifest.json @@ -0,0 +1,9 @@ +{ + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "FB_ID": "", + "FB_SECRET": "" + } +} diff --git a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml new file mode 100644 index 00000000..4b7eedf9 --- /dev/null +++ b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml @@ -0,0 +1,29 @@ +hwi_oauth: + # list of names of the firewalls in which this bundle is active, this setting MUST be set + firewall_names: [secured_area] + + # an optional setting to configure a query string parameter which can be used to redirect + # the user after authentication, e.g. /connect/facebook?_destination=/my/destination will + # redirect the user to /my/destination after facebook authenticates them. If this is not + # set then the user will be redirected to the original resource that they requested, or + # the base address if no resource was requested. This is similar to the behaviour of + # [target_path_parameter for form login](http://symfony.com/doc/2.0/cookbook/security/form_login.html). + # target_path_parameter: _destination + + # an optional setting to use the HTTP REFERER header to be used in case no + # previous URL was stored in the session (i.e. no resource was requested). + # This is similar to the behaviour of + # [using the referring URL for form login](http://symfony.com/doc/2.0/cookbook/security/form_login.html#using-the-referring-url). + # use_referer: true + + # here you will add one (or more) configurations for resource owners + # and other settings you want to adjust in this bundle, just checkout the list below! + resource_owners: + facebook: + type: facebook + client_id: '%env(FB_ID)%' + client_secret: '%env(FB_SECRET)%' + scope: "email" + options: + display: popup + csrf: true \ No newline at end of file diff --git a/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml b/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml new file mode 100644 index 00000000..2c11a501 --- /dev/null +++ b/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml @@ -0,0 +1,11 @@ +hwi_oauth_redirect: + resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml" + prefix: /connect + +hwi_oauth_connect: + resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml" + prefix: /connect + +hwi_oauth_login: + resource: "@HWIOAuthBundle/Resources/config/routing/login.xml" + prefix: /login \ No newline at end of file diff --git a/hwi/oauth-bundle/0.6/post-install.txt b/hwi/oauth-bundle/0.6/post-install.txt new file mode 100644 index 00000000..1299052b --- /dev/null +++ b/hwi/oauth-bundle/0.6/post-install.txt @@ -0,0 +1,20 @@ + + What's next for HWIOAuthBundle? + + + * Configure your application: + 1. Enable sessions by uncommenting the entire session section in config/packages/framework.yaml + 2. Add firewall by adding - secured_area: + anonymous: true + oauth: + resource_owners: + my_github: "/login/check-github" + login_path: /login + use_forward: false + failure_path: /login + + oauth_user_provider: + service: hwi_oauth.user.provider + in your security firewalls section. + + * Read the documentation at https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/3-configuring_the_security_layer.md From e6d9848043e4dbbe914c2a5804d6f8e32bbe3fe8 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Tue, 12 Jun 2018 08:15:07 +0300 Subject: [PATCH 2/9] fix symfony-flex-server request changes --- hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml | 6 +++--- hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml index 4b7eedf9..15af8c62 100644 --- a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml +++ b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml @@ -7,13 +7,13 @@ hwi_oauth: # redirect the user to /my/destination after facebook authenticates them. If this is not # set then the user will be redirected to the original resource that they requested, or # the base address if no resource was requested. This is similar to the behaviour of - # [target_path_parameter for form login](http://symfony.com/doc/2.0/cookbook/security/form_login.html). + # [target_path_parameter for form login](https://symfony.com/doc/2.0/cookbook/security/form_login.html). # target_path_parameter: _destination # an optional setting to use the HTTP REFERER header to be used in case no # previous URL was stored in the session (i.e. no resource was requested). # This is similar to the behaviour of - # [using the referring URL for form login](http://symfony.com/doc/2.0/cookbook/security/form_login.html#using-the-referring-url). + # [using the referring URL for form login](https://symfony.com/doc/2.0/cookbook/security/form_login.html#using-the-referring-url). # use_referer: true # here you will add one (or more) configurations for resource owners @@ -26,4 +26,4 @@ hwi_oauth: scope: "email" options: display: popup - csrf: true \ No newline at end of file + csrf: true diff --git a/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml b/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml index 2c11a501..ffab9d9f 100644 --- a/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml +++ b/hwi/oauth-bundle/0.6/config/routes/hwi_oauth_routing.yaml @@ -8,4 +8,4 @@ hwi_oauth_connect: hwi_oauth_login: resource: "@HWIOAuthBundle/Resources/config/routing/login.xml" - prefix: /login \ No newline at end of file + prefix: /login From ed9efa8394595be63d4995f8bb3fbadfca323482 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Tue, 12 Jun 2018 08:16:36 +0300 Subject: [PATCH 3/9] move manifest.json --- hwi/oauth-bundle/0.6/{config => }/manifest.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hwi/oauth-bundle/0.6/{config => }/manifest.json (100%) diff --git a/hwi/oauth-bundle/0.6/config/manifest.json b/hwi/oauth-bundle/0.6/manifest.json similarity index 100% rename from hwi/oauth-bundle/0.6/config/manifest.json rename to hwi/oauth-bundle/0.6/manifest.json From 6516ba969547da92e5c10854992a2a1050f3b633 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Tue, 12 Jun 2018 08:17:55 +0300 Subject: [PATCH 4/9] register bundle --- hwi/oauth-bundle/0.6/manifest.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hwi/oauth-bundle/0.6/manifest.json b/hwi/oauth-bundle/0.6/manifest.json index 641ea1d7..ac132ad4 100644 --- a/hwi/oauth-bundle/0.6/manifest.json +++ b/hwi/oauth-bundle/0.6/manifest.json @@ -1,4 +1,7 @@ { + "bundles": { + "HWI\\Bundle\\OAuthBundle\\HWIOAuthBundle": ["all"] + }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" }, From f1f4ee95579f7aaca60be769d13029f491e82244 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Wed, 20 Jun 2018 00:48:14 +0300 Subject: [PATCH 5/9] fix requested by Nyholm --- .../0.6/config/packages/framework.yaml | 1 + .../0.6/config/packages/hwi_oauth.yaml | 29 ++++--------------- hwi/oauth-bundle/0.6/post-install.txt | 3 +- 3 files changed, 8 insertions(+), 25 deletions(-) create mode 100644 hwi/oauth-bundle/0.6/config/packages/framework.yaml diff --git a/hwi/oauth-bundle/0.6/config/packages/framework.yaml b/hwi/oauth-bundle/0.6/config/packages/framework.yaml new file mode 100644 index 00000000..6cf3a112 --- /dev/null +++ b/hwi/oauth-bundle/0.6/config/packages/framework.yaml @@ -0,0 +1 @@ +framework.session.enabled: true \ No newline at end of file diff --git a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml index 15af8c62..89e2fc34 100644 --- a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml +++ b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml @@ -2,28 +2,11 @@ hwi_oauth: # list of names of the firewalls in which this bundle is active, this setting MUST be set firewall_names: [secured_area] - # an optional setting to configure a query string parameter which can be used to redirect - # the user after authentication, e.g. /connect/facebook?_destination=/my/destination will - # redirect the user to /my/destination after facebook authenticates them. If this is not - # set then the user will be redirected to the original resource that they requested, or - # the base address if no resource was requested. This is similar to the behaviour of - # [target_path_parameter for form login](https://symfony.com/doc/2.0/cookbook/security/form_login.html). - # target_path_parameter: _destination - - # an optional setting to use the HTTP REFERER header to be used in case no - # previous URL was stored in the session (i.e. no resource was requested). - # This is similar to the behaviour of - # [using the referring URL for form login](https://symfony.com/doc/2.0/cookbook/security/form_login.html#using-the-referring-url). - # use_referer: true - - # here you will add one (or more) configurations for resource owners - # and other settings you want to adjust in this bundle, just checkout the list below! + # https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/2-configuring_resource_owners.md resource_owners: - facebook: - type: facebook - client_id: '%env(FB_ID)%' - client_secret: '%env(FB_SECRET)%' - scope: "email" + any_name: + type: resource_owner_of_choice + client_id: + client_secret: options: - display: popup - csrf: true + csrf: true \ No newline at end of file diff --git a/hwi/oauth-bundle/0.6/post-install.txt b/hwi/oauth-bundle/0.6/post-install.txt index 1299052b..9c175efb 100644 --- a/hwi/oauth-bundle/0.6/post-install.txt +++ b/hwi/oauth-bundle/0.6/post-install.txt @@ -3,8 +3,7 @@ * Configure your application: - 1. Enable sessions by uncommenting the entire session section in config/packages/framework.yaml - 2. Add firewall by adding - secured_area: + 1. Add firewall by adding - secured_area: anonymous: true oauth: resource_owners: From 4de822d8d1cf91f1f2311df00d096e7b1d0e4c82 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Wed, 20 Jun 2018 00:49:32 +0300 Subject: [PATCH 6/9] symfony-flex-server request fix --- hwi/oauth-bundle/0.6/config/packages/framework.yaml | 2 +- hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hwi/oauth-bundle/0.6/config/packages/framework.yaml b/hwi/oauth-bundle/0.6/config/packages/framework.yaml index 6cf3a112..14ce5342 100644 --- a/hwi/oauth-bundle/0.6/config/packages/framework.yaml +++ b/hwi/oauth-bundle/0.6/config/packages/framework.yaml @@ -1 +1 @@ -framework.session.enabled: true \ No newline at end of file +framework.session.enabled: true diff --git a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml index 89e2fc34..79847580 100644 --- a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml +++ b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml @@ -9,4 +9,4 @@ hwi_oauth: client_id: client_secret: options: - csrf: true \ No newline at end of file + csrf: true From 2572991c3c5586537c772f63385377580df46535 Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Fri, 22 Jun 2018 13:45:57 +0300 Subject: [PATCH 7/9] remove framework.yaml --- hwi/oauth-bundle/0.6/config/packages/framework.yaml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 hwi/oauth-bundle/0.6/config/packages/framework.yaml diff --git a/hwi/oauth-bundle/0.6/config/packages/framework.yaml b/hwi/oauth-bundle/0.6/config/packages/framework.yaml deleted file mode 100644 index 14ce5342..00000000 --- a/hwi/oauth-bundle/0.6/config/packages/framework.yaml +++ /dev/null @@ -1 +0,0 @@ -framework.session.enabled: true From 6b1f43bb913e9f7e853dd05874d970bfe6bb7f3e Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Sat, 23 Jun 2018 10:11:13 +0300 Subject: [PATCH 8/9] add facebook as default --- hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml index 79847580..76823f79 100644 --- a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml +++ b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml @@ -4,9 +4,11 @@ hwi_oauth: # https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/2-configuring_resource_owners.md resource_owners: - any_name: - type: resource_owner_of_choice - client_id: - client_secret: + facebook: + type: facebook + client_id: '%env(FB_ID)%' + client_secret: '%env(FB_SECRET)%' + scope: "email" options: + display: popup csrf: true From 967fd3675d0075293bf56dc19fb6172d883e2aca Mon Sep 17 00:00:00 2001 From: andreybolonin Date: Mon, 25 Jun 2018 00:25:54 +0300 Subject: [PATCH 9/9] change firewall to main --- hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml index 76823f79..2ac3afb8 100644 --- a/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml +++ b/hwi/oauth-bundle/0.6/config/packages/hwi_oauth.yaml @@ -1,6 +1,6 @@ hwi_oauth: # list of names of the firewalls in which this bundle is active, this setting MUST be set - firewall_names: [secured_area] + firewall_names: [main] # https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/2-configuring_resource_owners.md resource_owners: