AuthorizeUsersForApp

Updated at:

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.NotFound is 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.AuthorizeBlockedBySet is returned.

  • If the workspace to which the app instance group belongs is an AD workspace, UserMeta must be specified, the value of UserMeta.Type must be ad, and the value of UserMeta.AdDomain must 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.MixNotSupported is 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 ExceedAppAuthUserQuota is returned. Removing authorization is not subject to the quota limit.

Call sequence

  1. 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).

  2. Call the DescribeUsers operation to obtain the usernames of the users to be authorized or whose authorization is to be removed.

  3. Call this operation to complete the authorization change.

Note

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

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: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:

  • CloudApp: WUYING Cloud App.

Valid values:

  • CloudApp :

    WUYING Cloud App.

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.

  • Must be specified when the workspace to which the app instance group belongs is an AD workspace: set Type to ad, and set AdDomain to the AD domain bound to the workspace.

  • If this parameter is not specified, the default WUYING convenience account (simple) is used.

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:

  • ad: AD account.

  • simple: WUYING convenience account.

Valid values:

  • ad :

    AD account.

  • simple :

    WUYING convenience account.

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.