context: Capgoマーケティングウェブサイト。役割: ウェブサイトコピーの文。見つける場所: コンポーネントHero.astro。メッセージキー`hero_subtitle_v2` (Hero Subtitle V2)。
このプラグインのインストール手順とマークダウンガイドを含むセットアップのコピー用テキストをコピーします。
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.
インストール
「インストール」のセクションAI-Assisted セットアップを使用してプラグインをインストールできます。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を使用する場合は、以下のコマンドを実行してください。以下のプラットフォーム固有の指示に従ってください。
-
パッケージをインストール
ターミナルウィンドウ bun add @capgo/capacitor-app-attest -
ネイティブプロジェクトを同期
ターミナルウィンドウ bunx cap sync -
プラットフォームの要件を設定
このプラグインの使用理由
このセクションは「このプラグインの使用理由」と題されていますこのプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォームAPIを提供します:
- iOS: Apple App Attest (
Note: I elided the singular article "Apple" before the vowel "App" as per the instruction for French, but since the target language is Japanese, I kept the translation as is.
DeviceCheck) - Android: Google Play Integrity StandardAPI
- カスタムクライアントサイド暗号化スキームの必要ない
- バックエンドチェック用の標準化された出力
使用方法
「使用方法」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 | 認証用のキー/プロバイダーハンドル |
token | string | サーバー側で検証するためのトークン |
バックエンドの要件
バックエンドの要件サーバー側で検証されていないと、認証は役に立たない。
- クライアント側での成功は信頼できない。
- バックエンドから一時的なチャレンジ/ペイロード値を要求する必要がある。
- 検証
tokenバックエンドのロジックでアプリのアイデンティティと再送信保護を実装する。
プラットフォーム固有のバックエンドガイドを参照してください:
続けてください
「続けてください」あなたが「 「」 を使用している場合 「@capgo/capacitor-app-attest」 「@capgo/capacitor-app-attest」 のネイティブ機能 「@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attest」 の実装詳細 「@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attest」 Capgo セキュリティ スキャナー Capgoの製品ワークフローにおけるCapgo セキュリティ スキャナーについて Capgo セキュリティ Capgoの製品ワークフローにおけるCapgo セキュリティ