# Rules app\_metadata passwordless universal is empty

**URL:** <https://community.auth0.com/t/rules-app-metadata-passwordless-universal-is-empty/12463>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [June 20, 2018, 3:18pm UTC](https://community.auth0.com/t/rules-app-metadata-passwordless-universal-is-empty/12463 "2018-06-20T15:18:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidh](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@davidh](https://community.auth0.com/u/davidh)\
**Post date:** [June 20, 2018, 3:18pm UTC](https://community.auth0.com/t/rules-app-metadata-passwordless-universal-is-empty/12463/1 "2018-06-20T15:18:10Z")

</div>

I defined a hosted page that has this lock definition :

> var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {  
> auth: {  
> redirectUrl: config.callbackURL,  
> responseType: “token id\_token”,  
> params: config.internalOptions,  
> audience: ‘[应用宝官网-全网最新最热手机应用游戏下载](http://myapp.com/crud)’,  
> params: {  
> scope: ‘openid email profile picture app\_metadata user\_metadata’  
> },
> 
> ```
> },
> assetsUrl: config.assetsUrl,
> allowedConnections: ['email'],
> rememberLastLogin: !prompt,
> language: language,
> languageDictionary: languageDictionary,
> theme: {
> //logo: 'YOUR LOGO HERE',
> //primaryColor: 'green'
> },
> closable: false,
> // uncomment if you want small buttons for social providers
> // socialButtonStyle: 'small'
> });
> 
> lock.show();
> 
> ```

I tried to define a rule and use a app\_metadata but it is empty though it is defined

> function (user, context, callback) {  
> const namespace = ‘[https://myapp.com/](https://myapp.com/)’;  
> console.log("app\_metadata: " +user.app\_metadata);  
> console.log("user: " +user);  
> console.log(“finished logging input”);
> 
> var role = ;  
> if(user.app\_metadata.hasOwnProperty(‘role’)){  
> role =user.app\_metadata.role;  
> }
> 
> context.idToken[namespace + ‘roles’] = role;  
> context.idToken[namespace + ‘customUserId’] = user.app\_metadata.customUserId;
> 
> callback(null, user, context);  
> }

User Json:

> {  
> “phone\_number”: “+1508314002”,  
> “phone\_verified”: true,  
> “name”: “+1508314002”,  
> “updated\_at”: “2018-06-20T12:44:12.524Z”,  
> “picture”: “[https://cdn.auth0.com/avatars/9.png](https://cdn.auth0.com/avatars/9.png)”,  
> “user\_id”: “sms|5b20e76e3020501cdsad4e75e66”,  
> “nickname”: “+972508314002”,  
> “identities”: [  
> {  
> “user\_id”: “5b20e76edssa3020501cd4e75e66”,  
> “provider”: “sms”,  
> “connection”: “sms”,  
> “isSocial”: false  
> }  
> ],  
> “created\_at”: “2018-06-13T09:45:01.171Z”,  
> “app\_metadata”: {  
> “role”: [  
> “admin”  
> ],  
> “customUserId”: “1234567890”  
> },  
> “last\_ip”: “109.67.6.143”,  
> “last\_login”: “2018-06-19T09:27:28.141Z”,  
> “logins\_count”: 5,  
> “blocked\_for”: ,  
> “guardian\_authenticators”:   
> }

---

<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:** [December 19, 2018, 12:01pm UTC](https://community.auth0.com/t/rules-app-metadata-passwordless-universal-is-empty/12463/3 "2018-12-19T12:01:07Z")

</div>

Hey @davidh !

As it has been more than a few months since this topic was opened and there has been no reply or further information provided from the community as to the existence of the issue we would like to check if you are still facing the described challenge?

We are more than happy to assist in any way! If the issue is still out there please let us know so we can create a new thread for better visibility, otherwise we’ll close this one in week’s time.

Thank you!

---

<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:** [December 24, 2018, 5:00pm UTC](https://community.auth0.com/t/rules-app-metadata-passwordless-universal-is-empty/12463/4 "2018-12-24T17:00:07Z")

</div>

This topic was automatically closed after 5 days. New replies are no longer allowed.
