# Search for users by authorized applications

**URL:** <https://community.auth0.com/t/search-for-users-by-authorized-applications/40809>\
**Category:** Get Help\
**Tags:** web, dashboard, user\
**Created:** [April 9, 2020, 5:27pm UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809 "2020-04-09T17:27:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![customautosys](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/customautosys/32/13540_2.png) [@customautosys](https://community.auth0.com/u/customautosys)\
**Post date:** [April 9, 2020, 5:27pm UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/1 "2020-04-09T17:27:07Z")

</div>

Hi, is there any way to search in the dashboard for all users by the applications they authorized? Maybe by Lucene syntax?

---

<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:** [April 10, 2020, 8:27am UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/2 "2020-04-10T08:27:49Z")

</div>

Hey there!

I’m not sure if I understand your usecase correctly. Can you expand on that?

---

<div class="post-metadata">

**Author:** ![customautosys](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/customautosys/32/13540_2.png) [@customautosys](https://community.auth0.com/u/customautosys)\
**Post date:** [April 11, 2020, 9:13am UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/3 "2020-04-11T09:13:01Z")

</div>

From the dashboard, after I click on Users & Roles → Users, I want to search for users according to the applications they have authorized. E.g. all users that have app x under the Authorized Applications tab when I click on that user. Is that possible?

---

<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:** [April 14, 2020, 8:49am UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/4 "2020-04-14T08:49:22Z")

</div>

Hey there!

Unfortunately that’s not possible. It would be doable via our Management API but I checked it and it’s not there. I suggest filing a feature request to our product team via our product feedback form:

> **[Auth0: Secure access for everyone. But not just anyone.](https://auth0.com/feedback)**
>
> Rapidly integrate authentication and authorization for web, mobile, and legacy applications so you can focus on your core business.

---

<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:** [April 14, 2020, 8:49am UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/5 "2020-04-14T08:49:30Z")

</div>



---

<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:** [April 20, 2020, 12:11pm UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/6 "2020-04-20T12:11:55Z")

</div>



---

<div class="post-metadata">

**Author:** ![customautosys](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/customautosys/32/13540_2.png) [@customautosys](https://community.auth0.com/u/customautosys)\
**Post date:** [April 20, 2020, 4:50pm UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/7 "2020-04-20T16:50:42Z")

</div>

Problem solved using management API & PHP.

```
<?php
require './vendor/autoload.php';

use Auth0\SDK\API\Management;

if(!isset($_POST['access_token'])||!isset($_POST['domain'])){
?>
<form method="post">
<p><input type="text" name="domain" placeholder="Domain"/></p>
<p><textarea name="access_token" placeholder="Access Token"></textarea></p>
<p><input type="submit"/></p>
</form>
<?php
}else{

$mgmt_api=new Management($_POST['access_token'],$_POST['domain']);

$clients=$mgmt_api->clients()->getAll();

$allUsers=[];

$userPage=null;
$page=0;
do{
	$userPage=$mgmt_api->users()->getAll([],null,null,$page++,100);
	foreach($userPage as $user){
		$allUsers[$user['user_id']]=$user;
	}
}while(is_array($userPage)&&count($userPage)>=100);

$uniqueUsers=[];

foreach($clients as $client){

	if($client['name']==='All Applications')continue;

	$users=[];

	$results=$mgmt_api->grants()->getByClientId($client['client_id']);

	foreach($results as $grant){
		$uniqueUsers[$grant['user_id']]=$users[$grant['user_id']]=$allUsers[$grant['user_id']];
	}

	$number=0;
?>
<h1>
<?php if(isset($client['logo_uri'])){ ?>
<img src="<?php echo $client['logo_uri']; ?>" style="max-width:64px;max-height:64px"/>
<?php } echo $client['name']; ?></h1>
<table>
<tr>
<th>S/N</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>User ID</th>
<th>Full JSON</th>
</tr>
<?php
	foreach($users as $user_id=>$user){
?>
<tr>
<td><?php echo ++$number; ?></td>
<td><?php echo $user['name']; ?></td>
<td><?php echo $user['email']; ?></td>
<td><?php echo $user['phone_number']; ?></td>
<td><?php echo $user_id ?></td>
<td><?php echo json_encode($user); ?></td>
</tr>
<?php
	}
?>
</table>
<?php
}
?>
Total unique users: 
<?php
echo count($uniqueUsers);
}
?>

```

---

<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:** [April 21, 2020, 9:19am UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/8 "2020-04-21T09:19:30Z")

</div>

Perfect! Thanks for sharing that with the rest of community!

---

<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:** [April 21, 2020, 9:19am UTC](https://community.auth0.com/t/search-for-users-by-authorized-applications/40809/9 "2020-04-21T09:19:34Z")

</div>


