您的问题似乎分为两个部分:
让应用程序链接正常工作
为此,您需要 assetlinks.json 文件包含这样的条目,如中所述安卓文档 https://developer.android.com/studio/write/app-link-indexing#associatesite。我的代码示例使用这些设置:
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.authsamples.basicmobileapp",
"sha256_cert_fingerprints": [
"62:7D:06:B1:01:C6:2F:04:9A:D4:5D:17:DF:FF:AB:65:13:8E:E0:CC:F6:60:2A:F6:3A:DA:1D:19:0A:F9:DF:15"
]
}
}
]
这不需要部署到 App Store。您可以通过运行我的来验证这一点示例应用程序 https://authguidance.com/basicandroidapp-execution/,它在安装时注册深层链接。我的应用程序使用类似的清单文件 https://github.com/gary-archer/oauth.mobilesample.android/blob/master/app/src/main/AndroidManifest.xml#L68给你的。如果您在模拟器上运行应用程序,则执行以下命令:
adb shell pm get-app-links --user cur
您将看到类似这样的输出,没有 1024。更多基础设施详细信息请参阅这篇博文 https://authguidance.com/android-infrastructure-setup/我的。
com.authsamples.basicmobileapp:
ID: 07f8ee96-dc1c-4df0-a7d7-2e9738902088
Signatures: [62:7D:06:B1:01:C6:2F:04:9A:D4:5D:17:DF:FF:AB:65:13:8E:E0:CC:F6:60:2A:F6:3A:DA:1D:19:0A:F9:DF:15]
Domain verification state:
mobile.authsamples.com: verified
User 0:
Verification link handling allowed: true
Selection state:
Disabled:
mobile.authsamples.com
让 WEBAUTHN / 密码本机登录正常运行
这是一个较新的功能,请使用FIDO 功能 https://developers.google.com/identity/fido/android/native-apps,并且需要额外注册,如下所示:
[
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "web",
"site": "https://mobile.authsamples.com"
}
}
]
它还需要几个步骤来指定asset_statements
在应用程序内,如链接中所述。
你的问题
在您的情况下,密钥注册看起来不错,您可以继续为用户实施密钥登录。您的问题令人困惑的是您正在查看应用程序链接注册详细信息。除非您包含以下内容,否则这些将不起作用handle_all_urls
value.
为了继续您的设置,我将更新为这种形式的 assetlinks.json,如链接中的建议。尽管您的重点可能是密钥登录,但如今任何移动应用程序支持深度链接都是有意义的,即使您最初不使用它。
[
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "android_app",
"package_name": "com.authsamples.basicmobileapp",
"sha256_cert_fingerprints": [
"62:7D:06:B1:01:C6:2F:04:9A:D4:5D:17:DF:FF:AB:65:13:8E:E0:CC:F6:60:2A:F6:3A:DA:1D:19:0A:F9:DF:15"
]
}
},
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "web",
"site": "https://mobile.authsamples.com"
}
}
]