시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
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.
-
패키지를 설치하세요
터미널 창 bun add @capgo/capacitor-app-attest -
자연어 프로젝트 동기화
터미널 창 bunx cap sync -
플랫폼 요구 사항을 구성하세요
- 완료 iOS 설정 App Attest 기능과 백엔드 검증 흐름을 위해
- 완료 Android 설정 Play Integrity 표준 및 백엔드 검증 흐름을 위한.
이 플러그인을 사용하는 이유
“이 플러그인을 사용하는 이유”라는 섹션이 플러그인은 한 번의 크로스 플랫폼 API를 제공하면서 네이티브 플랫폼 보안을 유지합니다:
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity 표준 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에서 동일한 키 필드를 반환하십시오:
| Field | Type | 설명 |
|---|---|---|
platform | 'ios' | 'android' | 'web' | 토큰을 생성한 네이티브 플랫폼 |
format | AttestationFormat | apple-app-attest 또는 google-play-integrity-standard |
keyId | string | 인증을 위해 사용되는 키/제공자 핸들 |
token | string | 서버에서 확인할 토큰 |
서버 측에서 검증된 경우에만 신뢰할 수 있는 attestation입니다.
- 클라이언트만 성공한 경우는 절대 신뢰하지 마세요.
- 백엔드에서 한번만 사용할 수 있는 challenge/payload 값을 요구하세요.
- 인증
token앱 식별, 그리고 백엔드 로직에서 재생용 보호 기능을 사용하세요.
플랫폼에 맞는 백엔드 가이드를 사용하세요: