Skip to content

list_web_authn_credentials async

list_web_authn_credentials(
    access_token: TokenModelType,
    *,
    config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
    next_token: Optional[PaginationKey] = None,
    max_results: Optional[WebAuthnCredentialsQueryLimitType] = None,
) -> ListWebAuthnCredentialsResponse

Generates a list of the currently signed-in user's registered passkey, or WebAuthn, credentials.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Parameters:

  • access_token (TokenModelType) –

    A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for aws.cognito.signin.user.admin.

  • next_token (Optional[PaginationKey], default: None ) –

    This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.

  • max_results (Optional[WebAuthnCredentialsQueryLimitType], default: None ) –

    The maximum number of the user's passkey credentials that you want to return.

Raises:

  • ForbiddenException –

    This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with your user pool.

  • 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.

  • LimitExceededException –

    This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.

  • 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.

  • PasswordResetRequiredException –

    This exception is thrown when a password reset is required.

  • TooManyRequestsException –

    This exception is thrown when the user has made too many requests for a given operation.

  • 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
async def list_web_authn_credentials(
    self,
    access_token: "capo_cognito_identity_provider.types.token_model_type.TokenModelType",
    *,
    config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
    next_token: Optional[
        "capo_cognito_identity_provider.types.pagination_key.PaginationKey"
    ] = None,
    max_results: Optional[
        "capo_cognito_identity_provider.types.web_authn_credentials_query_limit_type.WebAuthnCredentialsQueryLimitType"
    ] = None,
) -> "capo_cognito_identity_provider.types.list_web_authn_credentials_response.ListWebAuthnCredentialsResponse":
    """<p>Generates a list of the currently signed-in user's registered passkey, or WebAuthn, credentials.</p> <p>Authorize this action with a signed-in user's access token. It must include the scope <code>aws.cognito.signin.user.admin</code>.</p> <note> <p>Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html">Using the Amazon Cognito user pools API and user pool endpoints</a>.</p> </note>

    Args:
        access_token: <p>A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for <code>aws.cognito.signin.user.admin</code>.</p>
        next_token: <p>This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.</p>
        max_results: <p>The maximum number of the user's passkey credentials that you want to return.</p>

    Raises:
        capo_cognito_identity_provider.errors.forbidden_exception.ForbiddenException: <p>This exception is thrown when WAF doesn't allow your request based on a web ACL that's associated with your user pool.</p>
        capo_cognito_identity_provider.errors.internal_error_exception.InternalErrorException: <p>This exception is thrown when Amazon Cognito encounters an internal error.</p>
        capo_cognito_identity_provider.errors.invalid_parameter_exception.InvalidParameterException: <p>This exception is thrown when the Amazon Cognito service encounters an invalid parameter.</p>
        capo_cognito_identity_provider.errors.limit_exceeded_exception.LimitExceededException: <p>This exception is thrown when a user exceeds the limit for a requested Amazon Web Services resource.</p>
        capo_cognito_identity_provider.errors.not_authorized_exception.NotAuthorizedException: <p>This exception is thrown when a user isn't authorized.</p>
        capo_cognito_identity_provider.errors.operation_not_enabled_exception.OperationNotEnabledException: <p>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.</p>
        capo_cognito_identity_provider.errors.password_reset_required_exception.PasswordResetRequiredException: <p>This exception is thrown when a password reset is required.</p>
        capo_cognito_identity_provider.errors.too_many_requests_exception.TooManyRequestsException: <p>This exception is thrown when the user has made too many requests for a given operation.</p>
        capo_cognito_identity_provider.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cognito_identity_provider.types.list_web_authn_credentials_request.ListWebAuthnCredentialsRequest]",
    ) -> AsyncOperationResponse[
        "capo_cognito_identity_provider.types.list_web_authn_credentials_response.ListWebAuthnCredentialsResponse"
    ]:
        import capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.list_web_authn_credentials

        (
            output,
            http_response,
        ) = await capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.list_web_authn_credentials.async_list_web_authn_credentials(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cognito_identity_provider.types.list_web_authn_credentials_request.ListWebAuthnCredentialsRequest",
    ) -> dict[str, Any]:
        import capo_cognito_identity_provider.types.list_web_authn_credentials_request

        return capo_cognito_identity_provider.types.list_web_authn_credentials_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListWebAuthnCredentials", redact_input=_redact_input),
    )
    input_: capo_cognito_identity_provider.types.list_web_authn_credentials_request.ListWebAuthnCredentialsRequest = {
        "access_token": access_token
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output