Skip to content

Getting Started

GitHub

AIアシストされたセットアップを使用してプラグインをインストールできます。AIツールに次のコマンドを使用して、Capgoスキルを追加します。

ターミナル画面
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

次に、以下のプロンプトを使用してください:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-app-attest` plugin in my project.

Manual Setupを使用する場合は、以下のコマンドを実行してプラットフォーム固有の指示に従ってください:

  1. パッケージをインストール

    ターミナル画面
    bun add @capgo/capacitor-app-attest
  2. ネイティブプロジェクトを同期

    ターミナル画面
    bunx cap sync
  3. プラットフォームの要件を設定

    • 完了 iOS セットアップ iOS用のApp Attest機能とバックエンド検証フローのための設定です。
    • 完了 Android セットアップ Play Integrity Standardとバックエンド検証フローのためのAndroid用の設定です。

このプラグインを使用する理由

このプラグインの使用理由のセクション

このプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォーム API を提供します。

  • iOS: Apple App Attest (DeviceCheck)
  • Android: Google Play Integrity Standard API
  • カスタムクライアントサイド暗号化スキームなし
  • バックエンドチェック用の標準化された出力
import { AppAttest } from '@capgo/capacitor-app-attest';
const support = await AppAttest.isSupported();
if (!support.isSupported) {
throw new Error(`Attestation not supported on ${support.platform}`);
}
const prepared = await AppAttest.prepare();
const registration = await AppAttest.createAttestation({
keyId: prepared.keyId,
challenge: 'backend-one-time-registration-challenge',
});
const assertion = await AppAttest.createAssertion({
keyId: prepared.keyId,
payload: 'backend-one-time-request-payload',
});
console.log(registration.platform, registration.format, registration.token);
console.log(assertion.platform, assertion.format, assertion.token);

統一されたレスポンス形状

セクション:統一されたレスポンス形状

createAttestation() そして createAssertion() iOSとAndroidで同じキーフィールドを返します:

フィールドタイプ説明
platform'ios' | 'android' | 'web'ネイティブプラットフォームでトークンを生成したもの
formatAttestationFormatapple-app-attest または google-play-integrity-standard
keyIdstring証明のためのキー/プロバイダハンドル
tokenstring__CAPGO_KEEP_0__をバックエンドで検証するためのトークン

バックエンドの要件

バックエンドの要件

証明はサーバー側で検証されていないと役に立たない。

  • クライアントのみの成功は信頼できない。
  • バックエンドから一時的なチャレンジ/ペイロード値を要求する。
  • 検証 tokenアプリケーションID、そしてバックエンドロジック内でのリプレイ保護を使用する。

プラットフォーム固有のバックエンドガイドを使用してください:

Getting Startedから続けてください

Getting Startedから続けてくださいのセクション

Capgoを使用している場合 Getting Started セキュリティとコンプライアンスを計画するには、Capgoを @capgo/capacitor-app-attestを使用 @capgo/capacitor-app-attestのネイティブ機能 暗号化 暗号化の実装詳細 コンプライアンス コンプライアンスの実装詳細 Capgo セキュリティ スキャナー 製品ワークフローにおけるCapgo セキュリティ スキャナの機能について Capgo セキュリティ 製品ワークフローにおけるCapgo セキュリティの機能について