__CAPGO_KEEP_0__

Getting Started

GitHub

설치

설치

AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. 다음 명령어를 사용하여 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 Setup을 선호하시면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래에 플랫폼에 따라 설명된 지침을 따르세요:

  1. 패키지를 설치하세요

    터미널 창
    bun add @capgo/capacitor-app-attest
  2. 자연 프로젝트를 동기화하세요

    터미널 창
    bunx cap sync
  3. 플랫폼 요구 사항 구성

    • 완료 iOS 설정 애플 리뷰 능력과 백엔드 검증 흐름을 위해.
    • 완료 Android 설정 Play Integrity Standard과 백엔드 검증 흐름을 위해.

이 플러그인은 한 개의 크로스 플랫폼 API를 제공하면서 네이티브 플랫폼 보안을 유지합니다:

  • iOS: Apple App Attest (DeviceCheck)
  • Android: Google Play Integrity Standard API
  • __CAPGO_KEEP_0__
  • __CAPGO_KEEP_1__
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 or google-play-integrity-standard
keyIdstring인증에 사용되는 키/제공자 핸들
tokenstring서버에서 검증할 토큰

백엔드 요구 사항

백엔드 요구 사항

인증은 서버 측에서만 유용합니다.

  • 클라이언트만 성공하는 것을 절대 믿지 마세요.
  • 백엔드에서 한번만 사용할 수 있는 챌린지/페이로드 값을 요구하세요.
  • 검증 token앱 식별, 앱 ID, 및 재생 방지 기능을 백엔드 로직에서 사용하세요.

플랫폼별 백엔드 가이드를 사용하세요:

Getting Started에서 계속하기

Getting Started에서 계속하기

Capgo를 사용 중이라면 Getting Started 보안 및 규정 준수 계획을 위해 Capgo를 @capgo/capacitor-app-attest와 연결하세요 Capgo를 사용하여 @capgo/capacitor-app-attest의 네이티브 기능을 사용하세요 암호화 암호화 구현 세부 사항 규정 준수 Compliance 구현 세부 사항에 대해 Capgo 보안 스캐너 Capgo 보안 스캐너의 제품 워크플로에 대해, 및 Capgo 보안 Capgo 보안의 제품 워크플로에 대해,