# Accessing user\_metadata with social sign up

**URL:** <https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677>\
**Category:** Get Help\
**Tags:** social, user\_metadata, signup\
**Created:** [September 29, 2020, 7:32pm UTC](https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677 "2020-09-29T19:32:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.koev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter.koev/32/12872_2.png) [@peter.koev](https://community.auth0.com/u/peter.koev)\
**Post date:** [September 29, 2020, 7:32pm UTC](https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677/1 "2020-09-29T19:32:31Z")

</div>

Hello! I enabled social sign up with Google and Microsoft, but I am not able to access first and last name in user\_metadata. Here’s what I’m trying:

```auto
lock.getUserInfo(authResult.accessToken, function(error, profile) {
    if (!error) {
        console.log(profile);
    }
});

```

I get the following

```auto
{
  sub: "google-oauth2|xxx",
  email: "xxx@gmail.com", 
  email_verified: true
}

```

and if I try to use a rule to add a new property to `user.user_metadata` I get ‘Wrong credentials’ error. There’s another rule that adds `user_metadata` to a `idTokenPayload` property which contains first and last name ( the lock includes email, password, first and last name), but it’s only added when I sign up with username and password. Is there a way to get first and last name from social providers?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 30, 2020, 5:17pm UTC](https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677/3 "2020-09-30T17:17:39Z")

</div>

Hi @peter.koev,

Can you share all of your lock code? I am guessing you are missing the profile scope.

---

<div class="post-metadata">

**Author:** ![peter.koev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peter.koev/32/12872_2.png) [@peter.koev](https://community.auth0.com/u/peter.koev)\
**Post date:** [October 1, 2020, 11:10am UTC](https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677/4 "2020-10-01T11:10:13Z")

</div>

You’re correct! I hadn’t included the profile scope, but it’s in now. Thanks for the help!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 1, 2020, 3:09pm UTC](https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677/5 "2020-10-01T15:09:12Z")

</div>

Glad it was an easy fix! Let us know if you have any other questions. 😄

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 16, 2020, 3:09pm UTC](https://community.auth0.com/t/accessing-user-metadata-with-social-sign-up/50677/6 "2020-10-16T15:09:16Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
