验证 Android 应用链接失败并出现错误 1024

2024-04-12

我有一个带有 applicationId 的 Android 应用程序com.unibeam.passkey1.

At https://unibeam.github.io/.well-known/assetlinks.json,我存储了以下文件:

[{
  "relation": ["delegate_permission/common.get_login_creds"],
  "target": {
    "namespace": "web",
    "site": "https://unibeam.github.io"
  }
 },
 {
  "relation": ["delegate_permission/common.get_login_creds"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.unibeam.passkey1",
    "sha256_cert_fingerprints": [
      "55:E2:84:F9:9B:59:82:02:FA:2B:87:B9:90:77:8F:8D:62:3F:32:CC:76:92:47:0C:A8:73:7C:AE:11:8D:B6:0C",
      "0E:67:51:BF:E4:C4:01:7F:CB:7D:4C:1E:02:7E:DF:8D:40:25:9A:5C:20:2A:AB:96:71:15:F1:46:40:09:58:3D"
    ]
  }
 }]

2 个指纹对应应用程序的调试版本和发布版本。

并检查https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://unibeam.github.io&relation=delegate_permission/common.get_login_creds没有返回错误。

现在在应用程序内部manifest.xml,我有以下内容:

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="http" />
    <data android:scheme="https" />
    <data android:host="unibeam.github.io" />
</intent-filter>

问题是运行时adb shell pm get-app-links --user cur com.unibeam.passkey1它失败如下:

  com.unibeam.passkey1:
    ID: 24defbad-89a3-46d4-8446-335dfcdcd0a9
    Signatures: [0E:67:51:BF:E4:C4:01:7F:CB:7D:4C:1E:02:7E:DF:8D:40:25:9A:5C:20:2A:AB:96:71:15:F1:46:40:09:58:3D]
    Domain verification state:
      unibeam.github.io: 1024
    User 0:
      Verification link handling allowed: true
      Selection state:
        Disabled:
          unibeam.github.io

为什么会失败?该应用程序是否需要在 PlayStore 上才能运行?


您的问题似乎分为两个部分:

让应用程序链接正常工作

为此,您需要 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"
    }
  }
]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

验证 Android 应用链接失败并出现错误 1024 的相关文章

随机推荐

  • 在 vim 中查找变量的下一次出现

    我想知道是否 如何让 vim 查找下一次出现的变量 假设变量的名称只是 n 那么 n会给我所有出现过的那封信 但这并不总是很有帮助 我想我可以创建一个正则表达式来解决这个问题 但我想知道是否有一些我还不知道的命令 击键 由于我所有的谷歌搜索
  • 以字节为单位读取大文件

    EDIT 根据建议 我已开始实施以下内容 private string Reading string filePath byte buffer new byte 100000 FileStream strm new FileStream f
  • 在Google地图中动态绘制多边形

    我是安卓新手 我一直在尝试将视野应用到谷歌地图中我当前的位置 该图显示了 iOS 中 Google 地图上的 FOV 所以基本上我做了类似的事情 添加了 5 个具有不同 alpha 的三角形 以使整个 fov 成为渐变 我必须根据设备的方位
  • 如何改变下拉列表的宽度?

    我有一个列表框 我想减小它的宽度 这是我的代码
  • Laravel 命令无法在子类中调用 $this->info()

    我刚刚开始学习 PHP 中的 OO 基本概念 Foo php class Foo extends Command public function construct parent construct public function fire
  • 如何使用 jquery 在动态生成的文本区域上自动运行方法?

    我正在使用一个插件 https github com jaz303 jquery grab bag blob master javascripts jquery autogrow textarea js https github com j
  • C++ 内联字符串流

    我想用std stringstream创建格式化字符串 但使用内联类 所以我没有stringstream局部变量到处乱飞 我的意思是这样的 include
  • 使用 PHP 从网页中提取特定数据[重复]

    这个问题在这里已经有答案了 可能的重复 PHP 中的 HTML 抓取 https stackoverflow com questions 34120 html scraping in php 我想知道是否有任何方法可以从网页获取特定的文本字
  • Firestore 规则:resource.data.keys() 不包含读取中的所有字段

    设置 我在 Firebase Firestore 中有一个集合 其中包含以下字段 active created description displayName expires image type uid userName where ex
  • 什么是谓词调度

    我最近看到很多关于 Clojure 中谓词分派的讨论 想知道这件事是否有什么意义 换句话说 什么是谓词分派以及它与泛型函数 OOP 多态性和模式有何不同 谢谢 谓词分派包含泛型函数 OOP 多态性 模式匹配等 一个好的概述是谓词调度 统一的
  • Coldfusion onCFCRequest 将 XML 的返回类型更改为 WDDX

    我的客户群终于不再使用 Coldfusion 8 所以现在我可以利用 Coldfusion 9Application cfc gt onCFCRequest事件 我有一个测试场景设置 但结果不是我所期望的 我有一个我调用的方法 它会产生一个
  • AngularJS 角度种子启动项目添加指令

    我正在尝试使用角度种子项目 https github com angular angular seed https github com angular angular seed 开始一个新项目 我正在尝试添加一个新指令 创建了 testD
  • PyQt4 中的多列(可能使用 QTreeWidget)

    我正在尝试让 QTreeWidget 的工作方式与此完全相同 在Python中 我不关心多个选项卡 而是关心多个列 这就是我到目前为止所得到的 我不知道如何拥有多个标题 self pointListBox QtGui QTreeWidget
  • Visual Studio 2010 的替代 unistd.h 头文件

    我正在编译代码Visual Studio 2010其中包括头文件unistd h 由于windows不支持头文件unistd h 我正在寻找替代头文件 或者有什么方法可以自定义它 以便我也可以在 Visual Studio 中编译它 尝试包
  • 与构造函数同名的方法 - 为什么?

    为什么允许以下内容 public class Foo public Foo public void Foo 将方法命名为与类相同的名称是否有正当理由 我的猜测是 它是被允许的 因为明确禁止它会给 Java 的标识符命名规则添加另一个要求 但
  • 如何检查 Windows 应用商店应用程序中是否存在文件?

    还有其他方法可以检查 Windows 应用商店应用程序中是否存在文件吗 try var file await ApplicationData Current LocalFolder GetFileAsync Test xml no exce
  • if 块内 std::lock_guard 的范围

    目前正在研究关于std mutex并希望得到一些帮助 如果我有一个看起来像这样的代码 if returnBoolValue std lock guard
  • 页面刷新后如何保持div隐藏?

    我有一个简单的显示和隐藏 div 该 div 在加载页面时自动加载 然后您可以通过单击关闭来关闭该 div 一旦刷新页面 div 就会再次显示 我如何将其编码为一旦关闭 就不会再打开一个月 提前致谢 Ben 这是我到目前为止的代码
  • 在 0.19 中将自定义 HTML 与 elmreactor 或其他开发服务器结合使用

    As 这个答案 https stackoverflow com a 41366859 7943564显示可以在 Elm 0 18 中运行elm reactor如果此代码段包含在 HTML 文件中 则使用自定义 HTML 文件 然而 在 0
  • 验证 Android 应用链接失败并出现错误 1024

    我有一个带有 applicationId 的 Android 应用程序com unibeam passkey1 At https unibeam github io well known assetlinks json 我存储了以下文件 r