add hwi/oauth-bundle

This commit is contained in:
andreybolonin
2018-06-12 08:13:16 +03:00
parent 9c8068b95d
commit 609394f3eb
4 changed files with 69 additions and 0 deletions
@@ -0,0 +1,9 @@
{
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
"env": {
"FB_ID": "",
"FB_SECRET": ""
}
}
@@ -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
@@ -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
+20
View File
@@ -0,0 +1,20 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> What's next for HWIOAuthBundle? </>
<bg=blue;fg=white> </>
* <fg=blue>Configure</> your application:
1. Enable sessions by uncommenting the entire session section in <comment>config/packages/framework.yaml</>
2. Add firewall by adding <comment>- 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.
* <fg=blue>Read</> the documentation at <comment>https://github.com/hwi/HWIOAuthBundle/blob/master/Resources/doc/3-configuring_the_security_layer.md</>