# Auth0.getProfile gives back undefined (Node.js and Firebase)

**URL:** <https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330>\
**Category:** Get Help\
**Tags:** nodejs, firebase, firestore\
**Created:** [May 4, 2020, 11:20pm UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330 "2020-05-04T23:20:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanderisbestok](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sanderisbestok/32/21008_2.png) [@sanderisbestok](https://community.auth0.com/u/sanderisbestok)\
**Post date:** [May 4, 2020, 11:20pm UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330/1 "2020-05-04T23:20:47Z")

</div>

Hi all,

I am trying to implement (for the first time) Auth0 for my Google Action. I used [this](https://medium.com/google-developers/authenticating-smart-home-actions-for-the-google-assistant-with-auth0-b6fda3d2ee3d) tutorial and most of it seems to be working. However when I execute the code and check the logs I don’t get anything back from getProfile. It simply states undefined.

The code I use:

`const {AuthenticationClient} = require('auth0');`

```
const auth0 = new AuthenticationClient({
  'domain': 'MYDOMAIN.eu.auth0.com',
});

const app = smarthome();

const getEmail = async (headers) => {
  console.log(headers);
  const accessToken = headers.authorization.substr(7);
  console.log(accessToken);
  const {email} = await auth0.getProfile(accessToken);
  console.log(email);
  return email;
};

```

So when getEmail is called I don’t get any value, while accessToken is filled and I can’t figure out why.

---

<div class="post-metadata">

**Author:** ![zettiliazee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/zettiliazee/32/14541_2.png) [@zettiliazee](https://community.auth0.com/u/zettiliazee)\
**Post date:** [May 5, 2020, 2:06am UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330/2 "2020-05-05T02:06:40Z")

</div>

Have you tried including clientid as in code snippet ? ; const auth0 = new AuthenticationClient({  
‘clientId’: ‘clientIdentifier’,  
‘domain’: ‘.auth0.com’  
});

---

<div class="post-metadata">

**Author:** ![Annabelle](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/annabelle/32/12931_2.png) [@Annabelle](https://community.auth0.com/u/Annabelle)\
**Post date:** [May 5, 2020, 8:05am UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330/3 "2020-05-05T08:05:56Z")

</div>

I am following the example given in 01-Login in the auth0-examples, and it turns out I can’t get basic login prompt working. Here I provide the error message and the source related and hope to get help so that I can start using Auth0 [official website](https://www.prepaidcardstatus.net/)

---

<div class="post-metadata">

**Author:** ![sanderisbestok](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sanderisbestok/32/21008_2.png) [@sanderisbestok](https://community.auth0.com/u/sanderisbestok)\
**Post date:** [May 5, 2020, 8:55am UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330/4 "2020-05-05T08:55:18Z")

</div>

Hi,

Yes, that was what I had first (but literally with the word clientIdentifier in it) but that didn’t work either.

The other thing I changed is in:

const app = smarthome({  
jwt: require(‘./service-account-key.json’)  
});

I don’t have any json file included since I don’t know what file to include here? (If it is not from Auth0 it doesn’t seem to be needed either).

Btw how does Auth0 knows they can give back information at all if I use getProfile on firebase functions, how does Auth0 know I can ask information from the firebase domain? (Since the only domains I added in Auth0 config are the ones from Google Actions (which call Firebase after the login prompt)

---

<div class="post-metadata">

**Author:** ![sanderisbestok](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sanderisbestok/32/21008_2.png) [@sanderisbestok](https://community.auth0.com/u/sanderisbestok)\
**Post date:** [May 5, 2020, 8:55am UTC](https://community.auth0.com/t/auth0-getprofile-gives-back-undefined-node-js-and-firebase/42330/5 "2020-05-05T08:55:56Z")

</div>

Sorry, what do you mean with this?
