Mapping Google user data into User database

I’m currently stuck with Backendless.UserService.loginWithGooglePlusSdk() and its parameters googlePlusFieldsMapping and permissions.
As far as I understand, when the user logs in, you fetch Google user data via OpenId Connect, is that right? There is almost every data I need, but I would like to store user photo and birthday as well and I can’t find any corresponding field for mapping these data into Backendless User table. What can I do here?
In your login example, you are sending an empty list of permissions when the user is about to log in, I’m wondering when must we send a populated list of permissions and is there some example how to do that?
My code so far:

private void handleAccessTokenInBackendless(String idToken, String accessToken ) {
 Log.d(LOG_TAG, "idToken: " + idToken + ", accessToken: " + accessToken);
 Map<String, String> googlePlusFieldsMapping = new HashMap<>();
 googlePlusFieldsMapping.put("given_name", "first_name");
 googlePlusFieldsMapping.put("family_name", "last_name");
 googlePlusFieldsMapping.put("gender", "gender");
 googlePlusFieldsMapping.put("email", "email");
 googlePlusFieldsMapping.put("birthday", "birthday");
 googlePlusFieldsMapping.put("imageUri", "image_uri");
 List<String> permissions = new ArrayList<>();
 if (idToken != null && accessToken != null) {
 Backendless.UserService.loginWithGooglePlusSdk(idToken, accessToken, googlePlusFieldsMapping, permissions, new AsyncCallback<BackendlessUser>() {
 public void handleResponse(BackendlessUser backendlessUser) {
 Log.i(LOG_TAG, "Logged in to backendless, user id is: " + backendlessUser.getObjectId());
 public void handleFault(BackendlessFault backendlessFault) {
 Log.e(LOG_TAG, "Could not login to backendless: " + backendlessFault.getMessage() + " code: " + backendlessFault.getCode());

Regards :smiley:

Hi, FlipTrip!
You are right - OpenID Connect is used in LoginWithGooglePlusSdk. And it returns a limited number of fields as shown here.
Unfortunately, birthday is not available, but you can get user photo with this fieldsMapping:

googlePlusFieldsMapping.put( "picture", "picture" );

You don’t need any permissions for LoginWithGooglePlusSdk, so just leave them blank.

Hi guys, I am a newbie in backendless.
To use googlePlusFieldsMapping.put( “picture”, “picture” ), should I first create a custom field named “picture” in the users table in my backend? If so, should it be String type?
Thanks for your support