Symfony2 - HWIOAuthBundle 如何获取我在路径上设置的信息
Symfony2 - HWIOAuthBundle How to get the information that I set on paths
我正在我的项目中实施 this Bundle,但它提供了昵称、用户名、真实姓名、电子邮件等信息字段...
我还需要名字、姓氏和生日字段
如何添加或覆盖这些方法?
My Settings: config.yml
hwi_oauth:
firewall_name: secure_area
connect:
confirmation: false
resource_owners:
facebook:
type: facebook
client_id: 454595989899812
client_secret: eba0d566631eec3e012545a5f28443dd4
infos_url: "https://graph.facebook.com/me?fields=id,email,first_name,last_name,gender,birthday,locale,location,picture.type(square)"
scope: "public_profile,user_birthday,email"
paths:
email: email
firstname: first_name
lastname: last_name
gender: gender
birthday: birthday
profilepicture: picture.data.url
locale: locale
google:
type: google
client_id: <client_id>
client_secret: <client_secret>
#scope: "user:email"
fosub:
# try 30 times to check if a username is available (foo, foo1, foo2 etc)
username_iterations: 30
# mapping between resource owners (see below) and properties
properties:
facebook: facebook_id
google: google_id
如何获取设置路径的值?
谢谢!
$data = $response->getResponse();
...
$data["email"];
$data["picture"]["data"]["url"];
$data['first_name'];
$data['last_name'];
$data['locale'];
有路径:
$response->getEmail();
$response->getProfilepicture();
$response->getFirstname();
$repsonse->getLastname();
$repsonse->getLocale();
我正在我的项目中实施 this Bundle,但它提供了昵称、用户名、真实姓名、电子邮件等信息字段...
我还需要名字、姓氏和生日字段
如何添加或覆盖这些方法?
My Settings: config.yml
hwi_oauth:
firewall_name: secure_area
connect:
confirmation: false
resource_owners:
facebook:
type: facebook
client_id: 454595989899812
client_secret: eba0d566631eec3e012545a5f28443dd4
infos_url: "https://graph.facebook.com/me?fields=id,email,first_name,last_name,gender,birthday,locale,location,picture.type(square)"
scope: "public_profile,user_birthday,email"
paths:
email: email
firstname: first_name
lastname: last_name
gender: gender
birthday: birthday
profilepicture: picture.data.url
locale: locale
google:
type: google
client_id: <client_id>
client_secret: <client_secret>
#scope: "user:email"
fosub:
# try 30 times to check if a username is available (foo, foo1, foo2 etc)
username_iterations: 30
# mapping between resource owners (see below) and properties
properties:
facebook: facebook_id
google: google_id
如何获取设置路径的值?
谢谢!
$data = $response->getResponse();
...
$data["email"];
$data["picture"]["data"]["url"];
$data['first_name'];
$data['last_name'];
$data['locale'];
有路径:
$response->getEmail();
$response->getProfilepicture();
$response->getFirstname();
$repsonse->getLastname();
$repsonse->getLocale();