# How to fetch client\_metadata on lock screen?

**URL:** <https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589>\
**Category:** Get Help\
**Tags:** auth0-lock, lock-11, auth0\
**Created:** [April 5, 2019, 11:13am UTC](https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589 "2019-04-05T11:13:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jah](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jah/32/12805_2.png) [@jah](https://community.auth0.com/u/jah)\
**Post date:** [April 5, 2019, 11:13am UTC](https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589/1 "2019-04-05T11:13:34Z")

</div>

I have added few key value pairs in “Application Metadata” (client\_metadata) under advance settings of one of my application. Now I tried to fetch those key value pairs on lock screen but I couldn’t find any way. The @@config@@ object on lock screen doesn’t keep that information. I know there is an other option to make web request to auth0 management api and fetch client detail but I don’t want to make an extra call. So is there any way to fetch that info? Also if this is not possible then what is the best way to call auth0 management api before lock screen initialization and fetch the client\_metadata?

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [April 8, 2019, 4:00pm UTC](https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589/3 "2019-04-08T16:00:20Z")

</div>

Hey there @jah, you can use the Management API to work with the user’s metadata as discussed in the below doc. Give it a look and let me know if it helps you out or if you have any questions, thanks!

> You can use the [Management API](https://auth0.com/docs/api/management/v2) in order to retrieve, create, or update both the `user_metadata` and `app_metadata` fields at any point.

> **[Understand How Metadata Works in User Profiles](https://auth0.com/docs/manage-users/user-accounts/metadata)**
>
> Describes Auth0 user, application, and client metadata. Learn how you can use metadata to store information that does not originate from an identity provider.

---

<div class="post-metadata">

**Author:** ![jah](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jah/32/12805_2.png) [@jah](https://community.auth0.com/u/jah)\
**Post date:** [April 8, 2019, 4:32pm UTC](https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589/4 "2019-04-08T16:32:30Z")

</div>

Thanks for the answer. Now my scenario is i want to call the lock screen based on the value in client\_metadata. If the value is true for any application then i want to show lock passwordless screen else i want to show normal lock screen. So i need that info from management client before this step:  
var lock = new Authlock(…);  
How can i do that? Is there method provided by auth0 which will be called before initialization of lock sceen?

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [April 15, 2019, 9:12pm UTC](https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589/5 "2019-04-15T21:12:32Z")

</div>

Hey @jah, I followed up with one of our Senior engineers and found out that this would require a custom code solution leveraging Javascript, below we see the client\_metadata GET call to `/api/v2/client/{id}`, we need to modify this to instead of taking the `client_id` attribute that is located in the query string. This would return an object that would definitely need to be parsed and target out your desired dataset because it’s going to return everything. Sadly, we don’t have a written up example for this but it is possible. I hope this helps you in your quest but please be sure to let us know if you have any questions on topics in the future!

> #### Read `client_metadata` with the Management API
> 
> `client_metadata` is included amongst in the response to the `GET /api/v2/clients` and `GET /api/v2/client/{id}` endpoints

[https://auth0.com/docs/rules/guides/metadata#create-applications-with-client\_metadata-properties](https://auth0.com/docs/rules/guides/metadata#create-applications-with-client_metadata-properties)

---

<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 30, 2019, 9:12pm UTC](https://community.auth0.com/t/how-to-fetch-client-metadata-on-lock-screen/23589/6 "2019-04-30T21:12:34Z")

</div>

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