deleteWebAuthnCredential method

Future<void> deleteWebAuthnCredential({
  1. required String accessToken,
  2. required String credentialId,
})

Deletes a registered passkey, or WebAuthn, authenticator for the currently signed-in user.

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

May throw ForbiddenException. May throw InternalErrorException. May throw InvalidParameterException. May throw LimitExceededException. May throw NotAuthorizedException. May throw OperationNotEnabledException. May throw PasswordResetRequiredException. May throw ResourceNotFoundException. May throw TooManyRequestsException.

Parameter accessToken : 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.

Parameter credentialId : The unique identifier of the passkey that you want to delete.

Implementation

Future<void> deleteWebAuthnCredential({
  required String accessToken,
  required String credentialId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSCognitoIdentityProviderService.DeleteWebAuthnCredential'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    signed: false,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccessToken': accessToken,
      'CredentialId': credentialId,
    },
  );
}