exchangeAppAttestAssertion method

Accepts a AppAttest Artifact and Assertion, and uses the developer's preconfigured auth token to verify the token with Apple.

Returns an AttestationToken with the App ID as specified by the app field included as attested claims.

request - The metadata request object.

Request parameters:

app - Required. The full resource name to the iOS App. Format: "projects/{project_id}/apps/{app_id}" Value must have pattern ^projects/\[^/\]+/apps/\[^/\]+$.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleFirebaseAppcheckV1betaAttestationTokenResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GoogleFirebaseAppcheckV1betaAttestationTokenResponse>
    exchangeAppAttestAssertion(
  GoogleFirebaseAppcheckV1betaExchangeAppAttestAssertionRequest request,
  core.String app, {
  core.String? $fields,
}) async {
  final _body = convert.json.encode(request.toJson());
  final _queryParams = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final _url =
      'v1beta/' + core.Uri.encodeFull('$app') + ':exchangeAppAttestAssertion';

  final _response = await _requester.request(
    _url,
    'POST',
    body: _body,
    queryParams: _queryParams,
  );
  return GoogleFirebaseAppcheckV1betaAttestationTokenResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}