startWebAuthnRegistration method

Future<StartWebAuthnRegistrationResponse> startWebAuthnRegistration({
  1. required String accessToken,
})

Requests credential creation options from your user pool for the currently signed-in user. Returns information about the user pool, the user profile, and authentication requirements. Users must provide this information in their request to enroll your application with their passkey provider.

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 TooManyRequestsException. May throw WebAuthnConfigurationMissingException. May throw WebAuthnNotEnabledException.

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.

Implementation

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

  return StartWebAuthnRegistrationResponse.fromJson(jsonResponse.body);
}