I used GTLQueryPlus.queryForPeopleGetWithUserId("me") for retrieving logged in user information. I am not getting the gender in json. When I set the gender visibility to 'public' instead of 'my circles' from my google plus profile, then I got the gender.
How to get the gender info without changing the settings from googe plus profile settings?
scopes used: signIn.scopes = [kGTLAuthScopePlusMe, kGTLAuthScopePlusUserinfoProfile, kGTLAuthScopePlusLogin];
You can only access what a user has set to public. If the user doesn't want this information public then you cant have the information.
Just because I authenticate your application doesn't mean that I want you to for example to see my address or in this case my gender. So I don't set them public you cant see them.
Related
i do authorization in my app with huawei -
https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/get-user-info-0000001060261938
i want to get access token, then male request to obtain user info, but can't get
emailenter image description here
enter image description here
Two things you can check:
Image 1 shows the request parameter getNickname set as 1. According to the doc: "When getNickName is set to 1, the nickname is returned." Therefore it is possible for the response only show a displayName only (not an email). The email is usually masked as a display name.Attempt to can change getNickname = 0 and try again.
If above change is not working, according to the developer documentation, "...information, such as the...email address, can be obtained only if the app has the permission to obtain the information."
You can check that your app has the permission and has been properly applied to your app and try again.
Share
Edit
Follow
This is driving me cray. I am trying to retrieve the Facebook id after logging in. I am assuming I have to use the attribute mapping in order to achieve this? Any thoughts?
Heyo, Just thought I'd reply here too in case anyone else has questions about this.
I looked at the Facebook scopes reference page, and it says that public_profile is the scope that contains the user ID. So, I went to my Facebook Directory, and under 'Provider Configuration' on the 'Scopes' tab, I added public_profile. Under the 'Attribute Mappings' tab, I added id as the Attribute Name and set customData.id as the 'Stormpath Field Name'.
When users log in to my web app using their Facebook credentials, their ID is saved directly to their account's customData:
{
"id": "1260737122323"
}
To grab this data from the Account's customData and display it on the profile page of the React-Express sample project, you need to do two things:
Ensure that the web.me.expand.customData config is set to true in order to have the custom data fields populated,
Add a new field on the profile page with name="customData.id", like this:
This is covered in the docs under the Access custom data fields by prefixing field names with customData section.
The documentation of these Facebook scopes is a little confusing, the properties on "public_profile" are actually available on the root of the Facebook user object, so in Stormpath you want to map id to customData.public_profile.id.
I'm developing an application with ionic and Backand and I'm using the sign in with social accounts with the Backand service.
The social login process is OK, but I want to get the ID from Facebook and Google plus in order to get the profile picture.
I was talking with the support of Backand and I know that in Security and Auth there is an action "beforesocialSignUp" and I have not commented the line to get the data:
'use strict';
function backandCallback(userInput, dbRow, parameters, userProfile) {
// get facebook id and put in fuid field that you need to add to your user object
userInput.fuid = parameters.socialProfile.additionalValues.id;
// get gender from facebook and put in gender field that you need to add to your user object
// userInput.gender = parameters.socialProfile.additionalValues.gender;
}
And I have created the fuid field in my user object, but, when I make a login with Facebook or Google+ It doesn't save nothing. The login is OK but I can't get the ID data.
Any idea?
I had exactly the same problem.
The solution was to set the where condition of the BeforeSocialSignUp function from false to true.
This is nowhere in the documentation explained.
It took me 3 day ro figure this out :-(
Now the login works as expected and the fuid field gets assigned.
My next step is to get the profile picture from the FB Account, but therefore I have to make an API request to facebook with a user access token which I dont know how to get from backand.
Apparently when calling FB.login, the default permissions the user will have to give is this:
"xxx will receive the following info: your public profile and friend list".
And I know that I can add extra permissions with: { scope : 'email' } and so on.
The problem is, I don't want the whole public profile and the friend list.
The only thing I want is: first name, last name and email.
Is it possible to exclude the basic permissions and just have the ones I want?
No, not possible.
https://developers.facebook.com/docs/facebook-login/permissions/:
“When someone connects with an app using Facebook Login, the app can access their public profile and friend list, the pieces of information that are visible to everyone. ”
I'm trying to add some features to the users profile page, and for that I would need that users ID - just to clarify, it's not viewers ID I'm chasing, it's the ID of the user whose profile I'm viewing.
So, I used $subject = Engine_Api::_()->core()->getSubject('user'); and it returns a big object full of all kinds of data, but don't know how to extract user ID?
Anyone have a clue? (SocialEngine 4 is the platform I'm using)
this will get you the userid of the profile..
$profileownerid = Engine_Api::_()->core()->getSubject('user')->getIdentity();
I've figured it out: $subject_id = $subject->getIdentity(); and voila!