ListAuthorizedUsers
Performs a paging query on the authorized user list of a specified app instance group or app instance group set, and supports exact or fuzzy filtering by username.
Operation description
Operation description
This operation queries the currently authorized users of a specified app instance group (AppInstanceGroupId) or app instance group set (AppInstanceGroupSetId). It returns the username, account type, email address, phone number, and the authorization mode of the app instance group to which each user belongs.
This operation returns authorization relationships, which does not indicate that the users are currently online or have established connections.
In the Cloud Browser product, an app instance group is a cloud browser group, and the app instance group ID is the browser group ID.
The return scope depends on the authorization mode of the app instance group (the AuthMode response parameter):
When the authorization mode is
App(application authorization) orAppInstanceGroup(app instance group authorization): returns the users authorized by app instance group through the AuthorizeInstanceGroup operation and the users authorized by application through the AuthorizeUsersForApp operation. If AppId is specified, only the users specifically authorized for this application are returned.When the authorization mode is
Session(session authorization): returns the users who are granted persistent sessions, and lists all persistent session IDs granted to each user in AppInstancePersistentIds. If AppInstancePersistentId is specified, only the users granted this session are returned.When querying by app instance group set: returns the users authorized to the set. The AppInstanceGroupId response parameter is the primary app instance group ID of the set, and AppInstanceGroupSetId is the ID of the queried set.
When querying by app instance group, the results are sorted in descending order of authorization time, with the most recently authorized users listed first.
Before you begin
The target app instance group or app instance group set has been created, belongs to the current account, and its product type matches ProductType. Otherwise, a resource not found error code is returned.
Users have been authorized through the AuthorizeInstanceGroup or AuthorizeUsersForApp operation. If no users have been authorized, the operation returns a normal response with Users as an empty list and TotalCount as 0.
Parameter description
ProductType, PageNumber, and PageSize are required. If the value of ProductType is invalid, the
ProductTypeInvaliderror code is returned.You must specify either AppInstanceGroupId or AppInstanceGroupSetId, but not both. If both are specified or neither is specified, the
InvalidParameter.AppInstanceGroupId/AppInstanceGroupSetIderror code is returned.AppId and AppInstancePersistentId are not supported when querying by app instance group set. If either is specified, the
InvalidParameter.AppIdorInvalidParameter.AppInstancePersistentIderror code is returned.EndUserId performs exact match by username, and UserIdFuzzy performs fuzzy match by username (a hit occurs if the username contains the keyword). Both can be specified at the same time, and both conditions must be met.
PageNumber starts from 1. The value range of PageSize is 1 to 100.
When the authorization mode is
ApporAppInstanceGroup, TotalCount is the number of authorization records that meet the conditions. If the same user has multiple authorization records (for example, authorized for multiple applications), the user is merged into one in Users. Therefore, the number of users returned on the current page may be less than PageSize. Use TotalCount to determine whether to continue paging. When the authorization mode isSession, TotalCount is the number of deduplicated users.
Call sequence
Call the ListAppInstanceGroup operation to obtain the app instance group ID. For cloud browser groups, call the ListBrowserInstanceGroup operation.
Call the AuthorizeInstanceGroup operation to authorize by app instance group, or call the AuthorizeUsersForApp operation to authorize by application.
Call this operation to query the authorized users. To remove authorization, pass the returned EndUserId to the UnAuthorizeUserIds parameter of the preceding authorization operations.
Error codes
ProductTypeInvalid: The value of ProductType is invalid.InvalidParameter.AppInstanceGroupId/AppInstanceGroupSetId: Both AppInstanceGroupId and AppInstanceGroupSetId are specified, or neither is specified.InvalidParameter.AppId: AppId is specified when querying by app instance group set.InvalidParameter.AppInstancePersistentId: AppInstancePersistentId is specified when querying by app instance group set.InvalidAppInstanceGroupSpecItem.NotFound: The app instance group does not exist, does not belong to the current account, or the product type does not match.InvalidBrowserInstanceGroup.NotFound: When ProductType isCloudBrowser, the cloud browser group does not exist, does not belong to the current account, or the product type does not match.InvalidAppInstanceGroupSet.NotFound: The app instance group set does not exist, does not belong to the current account, the product type does not match, or there is no available primary app instance group in the set.InvalidAppInstanceGroupSet.ActivationFailed: The app instance group set is not in an available state.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
appstreaming:ListAuthorizedUsers |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProductType |
string |
Yes |
The product type. The value must be consistent with the product type of the queried app instance group or app instance group set. If they are inconsistent, a resource not found error code is returned. Valid values:
Valid values:
|
CloudApp |
| PageSize |
integer |
Yes |
The number of records returned per page. Valid values: 1 to 100. When the authorization mode is |
20 |
| PageNumber |
integer |
Yes |
The page number. Pages start from 1. |
1 |
| AppInstanceGroupId |
string |
No |
The app instance group ID. You can call the ListAppInstanceGroup operation to obtain the ID. For cloud browser groups, specify the browser group ID returned by the ListBrowserInstanceGroup operation. You must specify either this parameter or AppInstanceGroupSetId, but not both. |
aig-9ciijz60n4xsv**** |
| AppInstanceGroupSetId |
string |
No |
The app instance group set ID. You must specify either this parameter or AppInstanceGroupId, but not both. When querying by set, do not specify AppId or AppInstancePersistentId. Otherwise, a parameter error is returned. |
set-3jm9d0abc00example |
| AppId |
string |
No |
The application ID. This parameter is used to filter users who are specifically authorized for this application (authorized through the AuthorizeUsersForApp operation). This parameter applies to app instance groups whose authorization mode is If this parameter is not specified, all authorized users under the app instance group are returned. This parameter is not supported when querying by app instance group set. |
ca-i87mycyn419nu**** |
| EndUserId |
string |
No |
The username. Performs exact match by username. If this parameter is not specified, filtering by full username is not applied. This parameter can be specified together with UserIdFuzzy, and both conditions must be met. |
alice |
| UserIdFuzzy |
string |
No |
The username keyword. Performs fuzzy match by username. A hit occurs if the username contains this keyword. For example, if you specify |
ali |
| AppInstancePersistentId |
string |
No |
The persistent session ID. This parameter is used to filter users who are granted this persistent session. This parameter applies to app instance groups whose authorization mode is If this parameter is specified, only the users granted this session are returned. However, the AppInstancePersistentIds response parameter still lists all persistent sessions granted to the user. This parameter is not supported when querying by app instance group set. |
p-0cc7s3mw2fg4j**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The paged query result of authorized users. |
||
| PageNumber |
integer |
The current page number, which is the same as the PageNumber request parameter. |
1 |
| PageSize |
integer |
The number of records per page, which is the same as the PageSize request parameter. |
20 |
| RequestId |
string |
The request ID. |
5C1A4F2D-713A-5C98-8AF6-1B5D0868**** |
| TotalCount |
integer |
The total number of records that meet the query conditions. This parameter is used to determine whether to continue pagination.
|
1 |
| Users |
array<object> |
The list of authorized users on the current page. Multiple authorization records for the same user are merged into one item in the response. If no authorized users meet the conditions, an empty list is returned. |
|
|
object |
The information of an authorized user. |
||
| AccountType |
string |
The account type of the user. Valid values:
Valid values:
|
simple |
| AppId |
string |
The application ID. This parameter is returned only when AppId is specified in the request, and the value is the same as the request parameter. This parameter is not returned if AppId is not specified or when querying by app instance group set. |
ca-i87mycyn419nu**** |
| AppInstanceGroupId |
string |
The app instance group ID of the authorization relationship to which the user belongs. When querying by app instance group, this value is the same as the request parameter. When querying by app instance group set, this value is the primary app instance group ID of the set. |
aig-9ciijz60n4xsv**** |
| AppInstanceGroupSetId |
string |
The app instance group set ID. This parameter is returned only when querying by app instance group set, and the value is the same as the AppInstanceGroupSetId request parameter. |
set-3jm9d0abc00example |
| AppInstancePersistentIds |
array |
The list of persistent session IDs granted to the user. This parameter is returned only when the authorization mode (AuthMode) of the app instance group is |
|
|
string |
The persistent session ID. |
p-0cc7s3mw2fg4j**** |
|
| AuthMode |
string |
The authorization mode of the app instance group, which determines the return scope of this operation. Valid values:
When querying by app instance group set, the authorization mode of the primary app instance group of the set is returned. Valid values:
|
AppInstanceGroup |
|
string |
The email address of the user. This parameter is returned only when the account information of the user can be obtained. |
alice@example.com |
|
| EndUserId |
string |
The username. To remove authorization, you can pass this value to the UnAuthorizeUserIds parameter of the AuthorizeInstanceGroup or AuthorizeUsersForApp operation. |
alice |
| IsAuthAllApps |
string |
Specifies whether the current query is not restricted to a specific application. Valid values:
Note
This field is determined by whether the AppId request parameter is specified, and is independent of the actual scope of applications the user is authorized for. You cannot use this field to determine whether the user is authorized for all applications. Valid values:
|
true |
| Phone |
string |
The phone number of the user. This parameter is returned only when the account information of the user can be obtained. |
138****0000 |
Examples
Success response
JSON format
{
"PageNumber": 1,
"PageSize": 20,
"RequestId": "5C1A4F2D-713A-5C98-8AF6-1B5D0868****",
"TotalCount": 1,
"Users": [
{
"AccountType": "simple",
"AppId": "ca-i87mycyn419nu****",
"AppInstanceGroupId": "aig-9ciijz60n4xsv****",
"AppInstanceGroupSetId": "set-3jm9d0abc00example",
"AppInstancePersistentIds": [
"p-0cc7s3mw2fg4j****"
],
"AuthMode": "AppInstanceGroup",
"Email": "alice@example.com",
"EndUserId": "alice",
"IsAuthAllApps": "true",
"Phone": "138****0000"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.