# Unable to get user email id after authentication

**URL:** <https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134>\
**Category:** Get Help\
**Tags:** nodejs, electron, email, login, auth0\
**Created:** [April 5, 2022, 9:20am UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134 "2022-04-05T09:20:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShubhamMetkar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shubhammetkar/32/34921_2.png) [@ShubhamMetkar](https://community.auth0.com/u/ShubhamMetkar)\
**Post date:** [April 5, 2022, 9:20am UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/1 "2022-04-05T09:20:17Z")

</div>

I’m following this [article](https://auth0.com/blog/securing-electron-applications-with-openid-connect-and-oauth-2/) , [repo](https://github.com/auth0-blog/electron-openid-oauth) and things are great so far until I was trying to get user’s email ID. I tried adding “email” scope in the auth-service.js file & tried to retrieve this email id same way username & profile picture fields were done to get in home.js, adding supporting code:

```auto
webContents.on('dom-ready', () => {
  const profile = authService.getProfile();
  user_name = document.getElementById('name').innerText = profile.name;
  user_email = document.getElementById('email').innerText = profile.email;
});

```

but got email-id undefined ☹  
Am I missing anything here? please help me out from this @konrad.sopala , @dan.woda & @rueben.tiow  
Thank you 🙂

---

<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:** [April 5, 2022, 3:02pm UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/3 "2022-04-05T15:02:16Z")

</div>

Hi @ShubhamMetkar,

What are you seeing in the `profile` object?

---

<div class="post-metadata">

**Author:** ![ShubhamMetkar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shubhammetkar/32/34921_2.png) [@ShubhamMetkar](https://community.auth0.com/u/ShubhamMetkar)\
**Post date:** [April 6, 2022, 4:21am UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/4 "2022-04-06T04:21:36Z")

</div>

Hello @dan.woda , thank you for replying back,  
So this is what I got in profile object:  
{  
given\_name: ‘SHUBHAM’,  
family\_name: ‘METKAR’,  
nickname: ‘2018.shubham.metkar’,  
name: ‘SHUBHAM METKAR’,  
picture: ‘[https://lh3.googleusercontent.com/a-/AOh14GjJKt9jjk2skD6lhwYJw\_OEPAqhm\_KtegpAI8aN=s96-c](https://lh3.googleusercontent.com/a-/AOh14GjJKt9jjk2skD6lhwYJw_OEPAqhm_KtegpAI8aN=s96-c)’,  
locale: ‘en’,  
updated\_at: ‘2022-03-29T16:57:29.640Z’,  
iss: ‘[https://dev-3vgs7bqd.us.auth0.com/](https://dev-3vgs7bqd.us.auth0.com/)’,  
sub: ‘google-oauth2|107581881026254675326’,  
aud: ‘ePEaP1W8vo6qysq98F4vw9DXwVtW0MYU’,  
iat: 1649218462,  
exp: 1649254462  
}

---

<div class="post-metadata">

**Author:** ![ShubhamMetkar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shubhammetkar/32/34921_2.png) [@ShubhamMetkar](https://community.auth0.com/u/ShubhamMetkar)\
**Post date:** [April 6, 2022, 9:22am UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/6 "2022-04-06T09:22:31Z")

</div>

Hello @Moore69 , seems like links haven’t been added in the comment by you. Also it would be great if you could see the repo/article & then provide more specific solution/inputs regarding user email id.  
Thank you 🙂

---

<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:** [April 6, 2022, 4:04pm UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/7 "2022-04-06T16:04:42Z")

</div>

@ShubhamMetkar,

That appeared to be a spam user, apologies!

Can you please share how you are adding the `email` scope to the request? It appears that is the missing piece here.

---

<div class="post-metadata">

**Author:** ![ShubhamMetkar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shubhammetkar/32/34921_2.png) [@ShubhamMetkar](https://community.auth0.com/u/ShubhamMetkar)\
**Post date:** [April 8, 2022, 12:50pm UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/8 "2022-04-08T12:50:28Z")

</div>

Hello @dan.woda , I’m little surprised as I didn’t change anything in the code but all of sudden since today I started getting the email id in the object which is like this:  
{  
given\_name: ‘SHUBHAM’,  
family\_name: ‘METKAR’,  
nickname: ‘2018.shubham.metkar’,  
name: ‘SHUBHAM METKAR’,  
picture: ‘[https://lh3.googleusercontent.com/a-/AOh14GjJKt9jjk2skD6lhwYJw\_OEPAqhm\_KtegpAI8aN=s96-c](https://lh3.googleusercontent.com/a-/AOh14GjJKt9jjk2skD6lhwYJw_OEPAqhm_KtegpAI8aN=s96-c)’,  
locale: ‘en’,  
updated\_at: ‘2022-04-06T08:24:14.308Z’,  
email: ‘2018.shubham.metkar@ves.ac.in’,  
email\_verified: true,  
iss: ‘[https://dev-3vgs7bqd.us.auth0.com/](https://dev-3vgs7bqd.us.auth0.com/)’,  
sub: ‘google-oauth2|107581881026254675326’,  
aud: ‘ePEaP1W8vo6qysq98F4vw9DXwVtW0MYU’,  
iat: 1649416108,  
exp: 1649452108  
}

Nevermind, some strange situations in software development😅  
I’ll ping you in future if at all I get any error.  
Thank you for your time 🙂

---

<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:** [April 8, 2022, 3:37pm UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/9 "2022-04-08T15:37:22Z")

</div>

Sounds good. I’m going to mark this as resolved. Feel free to open a new topic if you see this issue again.

Thanks!

---

<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:** [May 25, 2022, 9:27pm UTC](https://community.auth0.com/t/unable-to-get-user-email-id-after-authentication/81134/10 "2022-05-25T21:27:01Z")

</div>


