admin_remove_user_from_group
async
¶
admin_remove_user_from_group(
user_pool_id: UserPoolIdType,
username: UsernameType,
group_name: GroupNameType,
*,
config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
) -> None
Given a username and a group name, removes them from the group. User pool groups are identifiers that you can reference from the contents of ID and access tokens, and set preferred IAM roles for identity-pool authentication. For more information, see Adding groups to a user pool.
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
Parameters:
-
user_pool_id(UserPoolIdType) –The ID of the user pool that contains the group and the user that you want to remove.
-
username(UsernameType) –The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If
usernameisn't an alias attribute in your user pool, this value must be thesubof a local user or the username of a user from a third-party IdP. -
group_name(GroupNameType) –The name of the group that you want to remove the user from, for example
MyTestGroup.
Raises:
-
InternalErrorException–This exception is thrown when Amazon Cognito encounters an internal error.
-
InvalidParameterException–This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
-
NotAuthorizedException–This exception is thrown when a user isn't authorized.
-
OperationNotEnabledException–This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.
-
ResourceNotFoundException–This exception is thrown when the Amazon Cognito service can't find the requested resource.
-
TooManyRequestsException–This exception is thrown when the user has made too many requests for a given operation.
-
UserNotFoundException–This exception is thrown when a user isn't found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity_provider/_services/async_cognito_identity_provider.py
2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 | |