ListAuthorizedUsers

Updated at:

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) or AppInstanceGroup (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 ProductTypeInvalid error code is returned.

  • You must specify either AppInstanceGroupId or AppInstanceGroupSetId, but not both. If both are specified or neither is specified, the InvalidParameter.AppInstanceGroupId/AppInstanceGroupSetId error code is returned.

  • AppId and AppInstancePersistentId are not supported when querying by app instance group set. If either is specified, the InvalidParameter.AppId or InvalidParameter.AppInstancePersistentId error 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 App or AppInstanceGroup, 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 is Session, TotalCount is the number of deduplicated users.

Call sequence

  1. Call the ListAppInstanceGroup operation to obtain the app instance group ID. For cloud browser groups, call the ListBrowserInstanceGroup operation.

  2. Call the AuthorizeInstanceGroup operation to authorize by app instance group, or call the AuthorizeUsersForApp operation to authorize by application.

  3. 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 is CloudBrowser, 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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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:

  • CloudApp: Wuying Cloud App

  • CloudBrowser: Cloud Browser

  • WuyingServer: Enterprise Edition workstation

  • WuyingWorkstation: Personal Edition Linggou container workstation

  • WuyingWorkstationTeam: Team Edition Linggou container workstation

  • WuyingWorkstationBusiness: Dedicated Edition Linggou container workstation

  • AndroidCloud: Cloud Phone

  • AIAgent: AgentBay (AI agent)

Valid values:

  • WuyingWorkstation :

    Personal Edition Linggou container workstation.

  • WuyingWorkstationTeam :

    Team Edition Linggou container workstation.

  • CloudApp :

    Wuying Cloud App.

  • CloudBrowser :

    Cloud Browser.

  • AIAgent :

    AgentBay (AI agent)

  • AndroidCloud :

    Cloud Phone.

  • WuyingWorkstationBusiness :

    Dedicated Edition Linggou container workstation.

  • WuyingServer :

    Enterprise Edition workstation.

CloudApp

PageSize

integer

Yes

The number of records returned per page. Valid values: 1 to 100.

When the authorization mode is App or AppInstanceGroup, pagination is based on authorization records. Multiple authorization records for the same user are merged into one user in the response. Therefore, the actual number of users returned on the current page may be less than this value.

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 App. You can obtain the application ID from the Apps list returned by the GetAppInstanceGroup operation.

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, both alice and ali.wang are matched. If this parameter is not specified, filtering by keyword is not applied.

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 Session. You can call the ListPersistentAppInstances operation to obtain the ID.

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.

  • When the authorization mode is App or AppInstanceGroup, this value is the number of authorization records. If the same user has multiple authorization records, the user is counted multiple times. Therefore, this value may be greater than the actual number of users.

  • When the authorization mode is Session, this value is the number of deduplicated users.

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:

  • simple: convenience account

  • ad: AD domain account from an enterprise AD domain

Valid values:

  • ad :

    AD domain account.

  • simple :

    Convenience account.

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 Session. This parameter is not affected by the filtering of the AppInstancePersistentId request parameter and always lists all persistent sessions granted to the user.

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:

  • App: Application authorization. This mode authorizes the applications under the app instance group to the user and does not restrict which sessions the user can use.

  • Session: Session authorization. This mode authorizes the persistent sessions under the app instance group to the user and does not restrict which applications the user can use. In this case, AppInstancePersistentIds returns the persistent sessions granted to the user.

  • AppInstanceGroup: App instance group authorization. This mode authorizes the entire app instance group to the user, allowing the user to use any session under the app instance group to open any application.

When querying by app instance group set, the authorization mode of the primary app instance group of the set is returned.

Valid values:

  • App :

    Application authorization.

  • AppInstanceGroup :

    App instance group authorization.

  • Session :

    Session authorization.

AppInstanceGroup

Email

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:

  • true: AppId is not specified in the request, and all authorized users under the app instance group are returned.

  • false: AppId is specified in the request, and only the users specifically authorized for this application are returned.

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 :

    Not restricted to a specific application.

  • false :

    Restricted to a specific application.

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.