시작하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
개요
디지털 애셋 링크 프로토콜 및 API를 사용하면 앱 또는 웹사이트에서 다른 앱이나 웹사이트에 관한 검증 가능한 공개 문을 작성할 수 있습니다. 예를 들어 웹사이트에서 특정 Android 앱과 연결되어 있다고 선언하거나 사용자 인증 정보를 다른 웹사이트와 공유하고자 한다고 선언할 수 있습니다.
다음은 디지털 애셋 링크의 몇 가지 가능한 용도입니다.
- 웹사이트 A는 앱이 설치된 경우 사이트 링크가 휴대기기의 지정된 앱에서 열려야 한다고 선언합니다.
- 웹사이트 A는 Chrome 사용자 인증 정보를 웹사이트 B와 공유할 수 있으므로 웹사이트 A에 로그인한 경우 웹사이트 B에 로그인할 필요가 없다고 선언합니다.
- 앱 A가 위치와 같은 기기 설정을 웹사이트 B와 공유할 수 있다고 선언합니다.
핵심 용어
- 주 구성원: 주 구성원은 설명을 하는 앱 또는 웹사이트입니다. Digital Asset Links에서 주 구성원은 항상 명세서 목록을 호스팅하는 앱 또는 웹사이트입니다.
- 문 목록: 명령문은 하나 이상의 명령문이 포함된 문 목록에 포함됩니다. 문 목록은 주 구성원이 제어하고 스푸핑하거나 조작하기 어려운 일반 텍스트이며 공개적으로 액세스할 수 있습니다.
독립형 파일일 수도 있고 다른 더 큰 항목의 섹션일 수도 있습니다. 예를 들어 웹사이트에서는 전체 파일이며, Android 앱에서는 앱 매니페스트의 섹션입니다.
문은 독점이 아닌 메서드를 사용하여 누구나 보고 확인할 수 있습니다. 자세한 내용은 명령문 목록 문서 참고
- 문: 문은 relation (문에서 지시하는 내용, 예: 사용자 인증 정보 공유 사용 설정)와 relation (관계가 적용되는 웹사이트 또는 앱)으로 구성된 긴밀히 구조화된 JSON 구조입니다. 따라서 각 문은 문장과 같습니다. 여기서 principal은 대상에 대한 관계를 말합니다.
- 문 소비자: 문 소비자는 주 구성원에게 문 목록을 요청하고, 지정된 주 구성원에 대한 문이 있는지 확인하고, 문이 존재하는 경우 지정된 작업을 수행할 수 있습니다. 자세한 내용은 문서 읽기 문서를 참고하세요.
빠른 사용 예
다음은 웹사이트 www.example.com에서 디지털 애셋 링크를 사용하여 해당 사이트의 URL 링크가 브라우저가 아닌 지정된 앱에서 열리도록 지정하는 방법을 보여주는 매우 간단한 예입니다.
- 웹사이트 www.example.com은 https://www.example.com/.well-known/assetlinks.json에 설명 목록을 게시합니다. 사이트에 있는 명령문 목록의 공식 이름 및 위치입니다. 다른 위치의 명령문 목록이나 다른 이름을 갖는 명령문 목록은 이 사이트에 유효하지 않습니다. 이 예에서 명령문 목록은 하나의 명령문으로 구성되며, Android 앱에 사이트의 링크를 열 수 있는 권한을 부여합니다.
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "com.example.app",
"sha256_cert_fingerprints": ["hash_of_app_certificate"] }
}]
명령문 목록은 [ ] 표시 내에 있는 구문 배열을 지원하지만, 예시 파일에는 하나의 명령문만 포함되어 있습니다.
sha256_cert_fingerprints
는 앱 서명 인증서의 SHA256 지문입니다.
자세한 내용은 Android App Links 문서를 참고하세요.
- 위 문에 나열된 Android 앱에는 처리하려는 URL의 스키마, 호스트, 경로 패턴(이 경우 https://www.example.com)을 지정하는 인텐트 필터가 있습니다. 인텐트 필터에는 Android M의 새로운 특수 속성인
android:autoVerify
이 포함되어 있습니다. 이 속성은 앱이 설치될 때 인텐트 필터에 설명된 웹사이트의 문을 확인해야 함을 나타냅니다.
- 사용자가 앱을 설치합니다. Android는
autoVerify
속성이 있는 인텐트 필터를 보고 지정된 사이트에 문 목록이 있는지 확인합니다. 문 목록이 있는 경우 Android는 이 파일에 앱에 링크 처리를 부여하는 문이 포함되어 있는지 확인하고 인증서 해시로 문과 앱을 대조합니다. 모든 것이 확인되면 Android는 https://www.example.com 인텐트를 example.com 앱으로 전달합니다.
- 사용자가 기기에서 https://www.example.com/puppies로 연결되는 링크를 클릭합니다. 이 링크는 브라우저, Google Search Appliance 추천 등
어디에나 있을 수 있습니다. Android는 이 인텐트를 example.com 앱에 전달합니다.
- example.com 앱이 인텐트를 수신하고 처리하기로 선택하여 앱에서 강아지 페이지를 엽니다. 어떤 이유로든 앱이 링크 처리를 거부했거나 앱이 기기에 없는 경우 링크는 해당 인텐트 패턴과 일치하는 다음 기본 인텐트 핸들러 (종종 브라우저)로 전송됩니다.
중요한 고려사항 및 제한사항:
- 프로토콜은 문을 작성하는 주 구성원을 인증하지 않지만 주 구성원과 밀접하게 연결되어 있고 주 구성원이 제어하는 특정 위치에 문이 있습니다.
- 이 프로토콜은 문 타겟을 인증하지는 않지만 호출자가 타겟을 인증할 수 있는 수단을 제공합니다 (예: 문은 인증서 해시 및 패키지 이름으로 모바일 앱 타겟을 식별합니다).
- 이 프로토콜은 기본적으로 문 작업을 실행하지 않습니다. 대신 문을 노출하는 기능을 사용할 수 있으며, 이때 소비 애플리케이션은 이를 검증한 후 조치 여부와 조치 방법을 결정해야 합니다. Android M은 기본적으로 이 단계를 수행합니다. 예를 들어 웹사이트에서 링크 처리를 특정 앱에 위임하는 경우 Android는 문을 확인 및 확인하고 타겟 앱을 확인한 다음 지정된 링크를 처리할 수 있는 옵션을 앱에 제공합니다.
- 이 프로토콜은 2개의 제3자에 대한 진술을 할 수 없습니다. 즉, 웹사이트 A는 웹사이트 B에 대한 문장을 만들 수 있지만 웹사이트 A는 웹사이트 B와 웹사이트 C의 관계에 대해 진술할 수 없습니다. 그러나 웹사이트 B가 웹사이트 A를 신뢰하는 경우, 웹사이트 A에서 웹사이트 C에 대한 권한을 부여하는 문장이 있는지 확인한 후 이를 구현하기로 결정할 수 있습니다.
다음 단계
- 사용 사례에 관한 명시적인 문서가 있는지 확인하세요.
- 명세서를 만드는 방법 알아보기
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-06-26(UTC)
[null,null,["최종 업데이트: 2024-06-26(UTC)"],[[["\u003cp\u003eDigital Asset Links enable apps and websites to make verifiable statements about their relationships with other apps and websites, such as link handling or credential sharing.\u003c/p\u003e\n"],["\u003cp\u003eThese statements are stored in a publicly accessible statement list, typically an "assetlinks.json" file hosted by the app or website making the statement.\u003c/p\u003e\n"],["\u003cp\u003eAndroid M and above automatically uses Digital Asset Links to verify website-to-app associations and direct links to the appropriate app if installed.\u003c/p\u003e\n"],["\u003cp\u003eThe protocol provides a foundation for trust and delegation between digital entities but relies on consumers to validate and act upon the statements.\u003c/p\u003e\n"]]],[],null,["# Getting Started\n\nOverview\n--------\n\nThe Digital Asset Links protocol and API enable an app or website to make public,\nverifiable *statements* about other apps or websites. For example, a website\ncan declare that it is associated with a specific Android app, or it can declare that\nit wants to share user credentials with another website.\n\nHere are some possible uses for Digital Asset Links:\n\n- Website A declares that links to its site should open in a designated app on mobile devices, if the app is installed.\n- Website A declares that it can share its Chrome user credentials with website B so that the user won't have to log in to website B if it is logged into website A.\n- App A declares that it can share device settings, such as location, with website B.\n\n### Key terms\n\n- **Principal:** The principal is the app or website making the statement. In Digital Asset Links, the principal is always the app or website that hosts the statement list.\n- **Statement list** : Statements are contained in a *statement list* that contains one or more statements. A statement list is cleartext and publicly accessible, in a location that is controlled by the principal and difficult to spoof or tamper with. It can be a free-standing file, or a section of another, larger item. For example, on a website, it is an entire file; in an Android app, it is a section in the app manifest. Statements can be viewed and verified by anyone, using non-proprietary methods. [See the statement list documentation for more information](/digital-asset-links/v1/create-statement).\n- **Statement:** A statement is a tightly structured JSON construct that consists of a *relation* (what the statement says to do, for example: Enable sharing credentials) and a *target* (the website or app that the relation applies to). Therefore, each statement is like a sentence, where *principal* says *relation* about *target* . \n- **Statement consumer:** A statement consumer requests a statement list from a principal, checks for the presence of a statement against a given principal, and if it exists, can perform the action specified. [See the statement comsuming documentation for more information](/digital-asset-links/v1/consuming)*.*\n\nQuick usage example\n-------------------\n\nHere's a very simplified example of how the website www.example.com could\nuse Digital Asset Links to specify that any links to URLs in that site should\nopen in a designated app rather than the browser:\n\n1. The website www.example.com publishes a statement list at https://www.example.com/.well-known/assetlinks.json. This is the official name and location for a statement list on a site; statement lists in any other location, or with any other name, are not valid for this site. In our example, the statement list consists of one statement, granting its Android app the permission to open links on its site: \n\n ```\n [{\n \"relation\": [\"delegate_permission/common.handle_all_urls\"],\n \"target\" : { \"namespace\": \"android_app\", \"package_name\": \"com.example.app\",\n \"sha256_cert_fingerprints\": [\"hash_of_app_certificate\"] }\n }]\n ```\n A statement list supports an array of statements within the \\[ \\] marks, but our example file contains only one statement. `sha256_cert_fingerprints` is the SHA256 fingerprints of your app's signing certificate. Find more details in the [Android App Links documentation](https://developer.android.com/training/app-links/verify-android-applinks#web-assoc).\n2. The Android app listed in the statement above has an intent filter that specifies the scheme, host, and path pattern of URLs that it wants to handle: in this case, https://www.example.com. The intent filter includes a special attribute `android:autoVerify`, new to Android M, which indicates that Android should verify the statement on the website described in the intent filter when the app is installed.\n3. A user installs the app. Android sees the intent filter with the `autoVerify` attribute and checks for the presence of the statement list at the specified site; if present, Android checks whether that file includes a statement granting link handling to the app, and verifies the app against the statement by certificate hash. If everything checks out, Android will then forward any https://www.example.com intents to the example.com app.\n4. The user clicks a link to https://www.example.com/puppies on their device. This link could be anywhere: in a browser, in a Google Search Appliance suggestion, or anywhere else. Android forwards the intent to the example.com app.\n5. The example.com app receives the intent and chooses to handle it, opening the puppies page in the app. If for some reason the app had declined to handle the link, or if the app were not on the device, then the link would have been sent to the next default intent handler matching that intent pattern (often the browser).\n\nImportant considerations and limitations:\n-----------------------------------------\n\n- The protocol does not authenticate the principal making the statement, but the statement is located in a specific location strongly associated with the principal, and under control of the principal.\n- The protocol does not authenticate the statement target, but it provides a means for the caller to authenticate the target (for example, a statement identifies mobile app targets by certificate hash and package name).\n- The protocol does not natively perform any statement actions; rather, it enables the ability to expose statements, which a consuming application must validate and then decide whether and how to act upon. Android M natively performs these steps for you; for example, if a website delegates link handling to a specific app, Android checks and verifies the statement, verifies the target app, and then offers the app the option to handle the given link.\n- The protocol does not enable making statements about two third parties: that is, website A can make a statement about website B, but website A cannot make a statement about website B's relationship to website C. However, if website B trusts website A, it can check website A for a statement granting permission to website C, and decide to implement that.\n\nNext steps\n----------\n\n1. [See if there is explicit documentation for your use case.](/digital-asset-links/v1/using)\n2. [Learn about creating a statement.](/digital-asset-links/v1/create-statement)"]]