Fields Mapping - Sign in with Google

I’m using loginWithOAuth2() function to add User information to Backendless, and everything works fine. I’m able to see those same information. However, apparently I haven’t configured fields mapping correctly, because I don’t see those specified information in Users table.

                mutableMapOf(
                    "email" to "email",
                    "given_name" to "first_name",
                    "family_name" to "last_name",
                    "picture" to "profile_photo"
                )

I’m using Sign in with Google provider to authenticate my users. I don’t know if I specified the right field names? I’ve used those names like ‘given_name’, ‘family_name’, ‘picture’ because I’ve seen those fields when I used JWT Token ID.

The key in this map, represents provider field name, and the value (on the right side) represent the column name that should be added in Users table on backendless.

Hi @Stefan_Jovanovic ,

Yes, you have specified correct mapping with correct provider fields.
Current behavior can be caused by absence of required scope for specified fields.
When you obtain user token you should provide scopes for email and profile. Those scopes described here Google API 용 OAuth 2.0 범위  |  Google ID 플랫폼  |  Google Developers

Could you please try once more to login using token which was obtained with both scopes?

Regards, Andriy

Yep, it works. Thanks Andriy!

You are welcome!

Regards, Andriy