# Empty user data problem with Auth0 SDK PHP and Universal Login

**URL:** <https://community.auth0.com/t/empty-user-data-problem-with-auth0-sdk-php-and-universal-login/102809>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [March 17, 2023, 4:57pm UTC](https://community.auth0.com/t/empty-user-data-problem-with-auth0-sdk-php-and-universal-login/102809 "2023-03-17T16:57:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roukmoute](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/roukmoute/32/44911_2.png) [@roukmoute](https://community.auth0.com/u/roukmoute)\
**Post date:** [March 17, 2023, 4:57pm UTC](https://community.auth0.com/t/empty-user-data-problem-with-auth0-sdk-php-and-universal-login/102809/1 "2023-03-17T16:57:35Z")

</div>

I would like to ask for your help regarding the use of the Auth0 PHP SDK in my project. Currently, I am implementing the “Universal Login” feature by connecting to a Custom Database Connections. From the logs, it seems that I am able to successfully connect and perform a “Success Exchange”. Moreover, for each of these logs, the e-mail address used for the connection is clearly visible.

On the other hand, when I perform an “exchange” in PHP, it works but the method `getUser()` : the user data are systematically empty. However, when I test the Universal Login from the Auth0 dashboard, I receive a complete JSON with the user’s information. I can’t figure out why the result differs in my PHP implementation.

Specifically, it’s the “/userinfo” API call that returns me a 200 code, but with an empty array.

Would you have any suggestions or recommendations to help me solve this situation? I thank you in advance for your advice and your kindness

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 20, 2023, 8:56am UTC](https://community.auth0.com/t/empty-user-data-problem-with-auth0-sdk-php-and-universal-login/102809/2 "2023-03-20T08:56:24Z")

</div>

Hey there!

It’s a better place for this type of question to ask it in a form of a GitHub issue in the PHP SDK repo here and discuss it directly with the repo maintainers:

> **[GitHub - auth0/auth0-PHP: PHP SDK for Auth0 Authentication and Management APIs.](https://github.com/auth0/auth0-PHP)**
>
> PHP SDK for Auth0 Authentication and Management APIs. - GitHub - auth0/auth0-PHP: PHP SDK for Auth0 Authentication and Management APIs.

Once you have a link to the issue you can share it here so we can ping them. Thank you!

---

<div class="post-metadata">

**Author:** ![roukmoute](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/roukmoute/32/44911_2.png) [@roukmoute](https://community.auth0.com/u/roukmoute)\
**Post date:** [March 20, 2023, 2:54pm UTC](https://community.auth0.com/t/empty-user-data-problem-with-auth0-sdk-php-and-universal-login/102809/3 "2023-03-20T14:54:03Z")

</div>

Hi!

Thanks for you answer.

I spent some time looking at the code and noticed that everything works fine! However, in order for the user to be returned correctly, it is important to provide a scope for Auth0. If the scope is not provided, the return will be an empty array for the user. Even if this seems normal, it would be useful to have logs to indicate that everything is working correctly. That way, if a user encounters a problem with a missing scope, they will know immediately where to look to solve the problem.

---

<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:** [April 3, 2023, 2:54pm UTC](https://community.auth0.com/t/empty-user-data-problem-with-auth0-sdk-php-and-universal-login/102809/4 "2023-04-03T14:54:39Z")

</div>

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