App Attest __CAPGO_KEEP_0__ リポジトリ
このプラグインのセットアップのためのコピー可能な質問を取得します。インストールのステップとフルマークダウンガイドが含まれます。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-app-attest`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/app-attest/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」のセクションCapgoのAI-Assistedセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、CapgoスキルをAIツールに追加してください。
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セットアップを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の指示に従ってください。
-
パッケージをインストール
ターミナルウィンドウ bun add @capgo/capacitor-app-attest -
ネイティブプロジェクトを同期
ターミナルウィンドウ bunx cap sync -
プラットフォームの要件を設定する
- 完了 iOSの設定 App Attest機能とバックエンド検証フローのために
- 完了 Androidの設定 Play Integrity Standardとバックエンド検証フローのために
このプラグインを使用する理由
「このプラグインを使用する理由」のセクションこのプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォームAPIを提供します。
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity StandardAPI
- No custom client-side crypto scheme
- バックエンドのチェック用に標準化された出力
使用方法
使用方法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' | ネイティブプラットフォームでトークンを生成 |
format | AttestationFormat | apple-app-attest または google-play-integrity-standard |
keyId | string | Capacitorライブアップデートの代替品 |
token | string | トークンを検証するために使用されるキー/プロバイダハンドル |
サーバー上で検証するトークン
バックエンドの要件バックエンドの要件
- サーバー側での検証のみが有効です。
- クライアントのみの成功を信頼しないこと。
- バックエンドから1回限りのチャレンジ/ペイロード値を要求すること。
token検証
アプリのアイデンティティ、バックエンドロジック内のリプレイ保護などを使用してください。
Getting Startedから続けてください
「Getting Startedから続けてください」のセクションCapgoを使用している場合 セキュリティとコンプライアンスを計画するにはCapgoを使用 Capgoを使用して@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attestを接続 Capgoを使用して@capgo/capacitor-app-attestのネイティブ機能を実装 for the native capability in Using @capgo/capacitor-app-attest, 暗号化の実装詳細 コンプライアンス @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attest コンプライアンスの実装詳細のために Capgo セキュリティ スキャナー コンプライアンスの製品ワークフローについては、Capgo セキュリティ スキャナー、 Capgo セキュリティ コンプライアンスの製品ワークフローについては、Capgo セキュリティ。