Skip to content

Commit

Permalink
Facebook compatibility for api 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ngodfraind committed Sep 21, 2015
1 parent 7094450 commit 8662279
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Resources/config/suggested/hwi_oauth.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
hwi_oauth:
# name of the firewall in which this bundle is active, this setting MUST be set
# These settings are overrided in Security/ResourceOwnerFactory. Don't waste your time editing them here. It won't work.
firewall_name: main
resource_owners:
facebook:
Expand All @@ -25,7 +26,7 @@ security:
main:
oauth:
resource_owners:
facebook: /login/check_facebook
facebook: facebook/login/check_facebook
login_path: /login
failure_path: /login
use_forward: false
Expand Down
8 changes: 3 additions & 5 deletions Resources/views/Facebook/button.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
});
}
</script>
<button class='btn btn-primary facebook-connect hide btn-block'>
<i class="fa fa-facebook-square"></i> {{ 'login'|trans({}, 'platform') }}
<div onlogin="fb_login();" class="fb-login-button" data-max-rows="1" data-size="xlarge"
data-show-faces="false" data-auto-logout-link="false">
</div>

<button onlogin="fb_login();" class="fb-login-button facebook-connect btn-block" data-max-rows="1" data-size="xlarge"
data-show-faces="false" data-auto-logout-link="false">
</button>
8 changes: 7 additions & 1 deletion Security/Hwi/ResourceOwnerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ public function getFacebookResourceOwner()
array(
'client_id' => $this->configHandler->getParameter('facebook_client_id'),
'client_secret' => $this->configHandler->getParameter('facebook_client_secret'),
'infos_url' => "https://graph.facebook.com/me?fields=id,name,first_name,last_name,email",
'scope' => 'email',
'paths' => array(),
'paths' => array(
'email' => 'email',
'firstname' => 'first_name',
'lastname' => 'last_name',
'nickname' => 'name'
),
'options' => array()
),
'facebook',
Expand Down

0 comments on commit 8662279

Please sign in to comment.