FIDO2 API를 사용하면 Android 애플리케이션이 사용자를 인증하기 위해 강력한 증명된 공개 키 기반 사용자 인증 정보를 생성하고 사용할 수 있습니다. 이 API는 BLE, NFC, USB 로밍 인증자 (보안 키) 사용을 지원하는 WebAuthn 클라이언트 구현과 사용자가 지문 또는 화면 잠금을 사용하여 인증할 수 있는 플랫폼 인증자를 제공합니다.
사용자가 웹사이트와 Android 애플리케이션에서 원활하게 사용자 인증 정보를 공유하도록 허용하는 것은 간단합니다. 이렇게 하려면 디지털 애셋 링크를 활용하세요.
웹사이트에 디지털 애셋 링크 JSON 파일을 호스팅하고 디지털 애셋 링크 파일 링크를 앱 매니페스트에 추가하여 연결을 선언할 수 있습니다.
예를 들어 https://example.com를 Android 앱 com.example.android과 연결하려면 다음 3단계가 필요합니다.
1단계: 도메인에서 assetlinks.json 호스팅
다음과 같은 JSON 파일을 만들고 https://example.com/.well-known/assetlinks.json에 호스팅합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-10(UTC)"],[[["\u003cp\u003eThe FIDO2 API enables Android apps to utilize strong, attested public key-based credentials for user authentication, supporting BLE, NFC, USB roaming authenticators, and platform authenticators like fingerprint or screen lock.\u003c/p\u003e\n"],["\u003cp\u003eIt facilitates user registration (associating an authenticator with an account) and signing (authenticating a user) through the Fido2ApiClient.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage Digital Asset Links to allow users to seamlessly share credentials between their website and Android application.\u003c/p\u003e\n"],["\u003cp\u003eEstablishing this interoperability involves hosting an assetlinks.json file on the website, linking to it in the app's manifest, and adding an asset_statements string resource to the strings.xml file.\u003c/p\u003e\n"]]],[],null,["# FIDO2 API for Android\n\nThe FIDO2 API allows Android applications to create and use strong, attested\npublic key- based credentials for the purpose of authenticating users. The API\nprovides a [WebAuthn Client](https://www.w3.org/TR/webauthn/#webauthn-client)\nimplementation, which supports the use of BLE, NFC, and USB roaming\nauthenticators (security keys) as well as a platform authenticator, which allows\nthe user to authenticate using their fingerprint or screen lock.\n| **Note:** If your app requires passkeys, you should use [Credential Manager](/identity/android-credential-manager) instead.\n\nIntegration\n-----------\n\nThe [FIDO2 API](https://developers.google.com/android/reference/com/google/android/gms/fido/fido2/package-summary)\nentry point is the [Fido2ApiClient](https://developers.google.com/android/reference/com/google/android/gms/fido/fido2/Fido2ApiClient).\n\nThe API supports two operations:\n\n- [Registration](/android/reference/com/google/android/gms/fido/fido2/Fido2ApiClient#getRegisterIntent(com.google.android.gms.fido.fido2.api.common.MakeCredentialOptions)) is done once per authenticator per account, when the user associates an authenticator with an account.\n- [Signing](/android/reference/com/google/android/gms/fido/fido2/Fido2ApiClient#getSignIntent(com.google.android.gms.fido.fido2.api.common.PublicKeyCredentialRequestOptions)) is done whenever the relying party wants to authenticate a user.\n\nBoth registration and signing require user interaction.\n\nInteroperability with your website\n----------------------------------\n\nIt is simple to allow users to seamlessly share credentials across your website\nand Android application. To do so, leverage [the Digital Asset Links](https://digitalassetlinks.org).\nYou can declare associations by hosting a Digital Asset Links JSON file on your\nwebsite, and adding a link to the Digital Asset Link file to your app's manifest.\n\nFor example, if you want to associate `https://example.com` with an Android app\n`com.example.android`, here's 3 required steps:\n\n### Step 1. Host `assetlinks.json` at your domain\n\nCreate a JSON file like this and host it at `https://example.com/.well-known/assetlinks.json`. \n\n [\n {\n \"relation\" : [\n \"delegate_permission/common.handle_all_urls\",\n \"delegate_permission/common.get_login_creds\"\n ],\n \"target\" : {\n \"namespace\" : \"web\",\n \"site\" : \"https://example.com\"\n }\n },\n {\n \"relation\" : [\n \"delegate_permission/common.handle_all_urls\",\n \"delegate_permission/common.get_login_creds\"\n ],\n \"target\" : {\n \"namespace\" : \"android_app\",\n \"package_name\" : \"com.example.android\",\n \"sha256_cert_fingerprints\" : [\n \"DE:AD:BE:EF\"\n ]\n }\n }\n ]\n\nMake sure it's crawlable from Google and is served with HTTP header\n`Content-Type: application/json`.\n\n`sha256_cert_fingerprints` is the SHA256 fingerprints of your app's signing certificate.\nFind more details in the [Android App Links documentation](https://developer.android.com/training/app-links/verify-site-associations#web-assoc).\n| **Note:** The `relation` will eventually only require `\"delegate_permission/common.get_login_creds\"` in order to share credentials between websites and apps, however, until we complete migrating our logic to accept it, please include both `\"delegate_permission/common.handle_all_urls\"` and `\"delegate_permission/common.get_login_creds\"`.\n\n### Step 2. Link to `assetlinks.json` in Android app\n\nIn your Android app, add the following line to the manifest file under `\u003capplication\u003e`: \n\n \u003cmeta-data android:name=\"asset_statements\" android:resource=\"@string/asset_statements\" /\u003e\n\n### Step 3. Add an `asset_statements` string resource to the strings.xml file\n\nThe `asset_statements` string is a JSON object that specifies the `assetlinks.json`\nfiles to load. You must escape any apostrophes and quotation marks you use in\nthe string. For example: \n\n \u003cstring name=\"asset_statements\" translatable=\"false\"\u003e\n [{\n \\\"include\\\": \\\"https://example.com/.well-known/assetlinks.json\\\"\n }]\n \u003c/string\u003e\n\nTo learn more about associating your app and your website, read the [SmartLock\nfor Passwords on Android documentation](/identity/smartlock-passwords/android/associate-apps-and-sites)."]]