AuthorizeUsersForApp
Adds or removes authorized users for a specified application deployed in an app instance group. Only authorized users can access the application.
Operation description
Operation description
This operation manages user authorization for an app instance group at the application level. The authorization result applies only to the application specified by AppId and does not affect the authorization relationships of other applications in the app instance group. To authorize users for the entire app instance group, call the AuthorizeInstanceGroup operation.
Before you begin
The app instance group is created, and the application specified by AppId is deployed in the image used by the app instance group. Otherwise, the error code
InvalidAppId.NotFoundis returned.The app instance group is not added to an active app instance group set. App instance groups added to a set cannot be authorized individually and must be authorized through the set. Otherwise, the error code
InvalidAppInstanceGroup.AuthorizeBlockedBySetis returned.If the workspace to which the app instance group belongs is an AD workspace, UserMeta must be specified, the value of
UserMeta.Typemust bead, and the value ofUserMeta.AdDomainmust be the same as the AD domain bound to the workspace.If the app instance group has been authorized through a user group and mixed authorization of users and user groups is not supported, you cannot authorize individual users. Otherwise, the error code
AuthAppInstanceGroup.MixNotSupportedis returned.
Parameter description
Specify at least one of AuthorizeUserIds and UnAuthorizeUserIds, or specify both. If both are empty, no authorization relationships are changed when you invoke this operation.
When adding authorization, the sum of the current number of authorized users for the application and the number of newly added users cannot exceed the authorized user quota for the application. If the quota is exceeded, the error code
ExceedAppAuthUserQuotais returned. Removing authorization is not subject to the quota limit.
Call sequence
Call the ListAppInstanceGroup or GetAppInstanceGroup operation to obtain the app instance group ID (AppInstanceGroupId) and the application IDs of the applications deployed in the app instance group (AppId in the Apps list).
Call the DescribeUsers operation to obtain the usernames of the users to be authorized or whose authorization is to be removed.
Call this operation to complete the authorization change.
After the authorization is changed, the selected users will receive a notification email. Generally, it takes about 2 minutes for the changes to take effect on the terminal.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
appstreaming:AuthorizeUsersForApp |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AppInstanceGroupId |
string |
Yes |
The app instance group ID. You can call the ListAppInstanceGroup operation to obtain the ID. The application specified by AppId must be deployed in the image used by the app instance group. |
aig-9ciijz60n4xsv**** |
| ProductType |
string |
Yes |
The product type. Application-level authorization applies to WUYING Cloud App app instance groups. Valid values:
Valid values:
|
CloudApp |
| AuthorizeUserIds |
array |
No |
The list of usernames to be authorized for the application. You can specify up to 100 usernames at a time. Specify at least one of AuthorizeUserIds and UnAuthorizeUserIds, or specify both. Adding authorization is subject to the authorized user quota limit of the application. |
|
|
string |
No |
The username to be authorized. You can call the DescribeUsers operation to obtain the username. |
alice |
|
| UnAuthorizeUserIds |
array |
No |
The list of usernames whose authorization for the application is to be removed. You can specify up to 100 usernames at a time. Specify at least one of AuthorizeUserIds and UnAuthorizeUserIds, or specify both. Removing authorization is not subject to quota limits. |
|
|
string |
No |
The username whose authorization is to be removed. You can call the DescribeUsers operation to obtain the username. |
tom |
|
| UserMeta |
object |
No |
The account information of the authorized user, which is used to specify the account type corresponding to the username.
|
|
| AdDomain |
string |
No |
The AD domain name. Specify this parameter when Type is set to ad. The value must be the same as the AD domain bound to the workspace to which the app instance group belongs. |
example.com |
| Type |
string |
No |
The account type. Default value: simple. Valid values:
Valid values:
|
simple |
| AppId |
string |
Yes |
The application ID. The application must be deployed in the image used by the app instance group. You can obtain the ID from the Apps list returned by the GetAppInstanceGroup operation. |
ca-i87mycyn419nu**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
Examples
Success response
JSON format
{
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.