自助服务终端模式检测
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
PWA 自助服务终端应用可以使用 Chrome Verified Access API 实现 ChromeOS 自助服务终端检测。它基于现有的 Verified Access API 技术,只有本指南中详细介绍的几个关键区别。
初始设置
使用 Verified Access API 检测自助服务终端模式所需的设置步骤与已验证的访问权限前提条件中列出的步骤相同。如需在受管理的 Chromebook 设备上设置和启动自助服务终端应用,您还需要执行一些其他步骤。
在 Google 管理控制台中,执行以下操作:
- 按照本指南安装您的自助服务终端应用(第 1 步),然后将配套扩展程序添加到自助服务终端应用(第 3 步)。
- 对于自助服务终端配套扩展程序,请在证书管理下启用允许企业验证设置
实施步骤
有三个主要组件可用于实现已验证的访问权限自助服务终端检测:PWA 自助服务终端应用、配套 Chrome 扩展程序和网络服务。
PWA 自助服务终端应用
PWA 是您的主自助服务终端应用。它会向配套扩展程序发送消息,以启动自助服务终端模式检测流程,让它知道开始验证流程。
配套 Chrome 扩展程序
配套的 Chrome 扩展程序会与自助服务终端 PWA 一起运行,并且应监听来自 PWA 的传入消息。收到开始验证流程的消息后
- 调用 Verified Access API 以创建验证
- 对生成的质询调用 enterprise.platformKeys API,以使用企业用户密钥(使用
"USER"
范围的用户)创建质询响应
- 向要验证的网络服务发送包含质询响应的请求
如需了解详情和代码示例,请参阅开发者指南。
网络服务
当您的网络服务收到扩展程序发来的验证质询响应请求时,请使用 verify 方法。如需检测自助服务终端模式,请将 expectedIdentity
设置为 "KIOSK_MODE"
。如果成功,您应该看到由空字符串或空 JSON 构成的响应正文,这表示设备处于自助服务终端模式。如果设备未处于自助服务终端模式,系统会在响应正文中返回 404 代码以及错误消息 "Requested entity was not found"
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003ePWA kiosk apps can utilize the Chrome Verified Access API to detect if a ChromeOS device is in kiosk mode.\u003c/p\u003e\n"],["\u003cp\u003eSetup involves configuring your kiosk app and companion extension in the Google Admin Console, enabling specific settings for enterprise challenge.\u003c/p\u003e\n"],["\u003cp\u003eImplementation requires a PWA kiosk app to initiate verification, a companion Chrome extension to handle the API calls and communication with the network service, and a network service to verify the device's kiosk mode status.\u003c/p\u003e\n"],["\u003cp\u003eThe verification process leverages the Verified Access API to create and validate a challenge-response, confirming kiosk mode if successful.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should refer to the provided guides and documentation for detailed instructions and code samples to implement this functionality.\u003c/p\u003e\n"]]],[],null,["# Kiosk mode detection\n\nPWA kiosk apps can implement ChromeOS kiosk detection with the Chrome Verified\nAccess API. It builds on the existing Verified Access API technology with just\na few key differences detailed in this guide.\n\nSetup\n-----\n\nThe setup steps needed for using the Verified Access API to do kiosk mode\ndetection are the same as those listed in the\n[prerequisites for Verified Access](/chrome/verified-access/developer-guide#prerequisites_to_verified_access).\nThere are some additional\nsteps to setup and launch your kiosk app on the managed Chromebook device.\n\nIn the [Google Admin Console](https://admin.google.com/), do the following:\n\n- Follow [this guide](https://support.google.com/chrome/a/answer/9781496) to install your kiosk app (step 1) and add your companion extension to the kiosk app (step 3).\n- For the kiosk companion extension, enable the **Allow enterprise challenge** setting under **Certificate management**\n\nImplementation\n--------------\n\nThere are three main components to implement Verified Access kiosk detection: a\nPWA kiosk app, companion Chrome extension, and network service.\n\n### PWA kiosk app\n\nThe PWA is your main kiosk app. It kicks off the process of kiosk mode detection\nby [sending a message to the companion extension](https://chromeos.dev/en/kiosk/connecting-an-extension-from-a-kiosk-pwa),\nletting it know to start the verification process.\n\n### Companion Chrome extension\n\nThe companion Chrome extension runs with the kiosk PWA and should listen to\nincoming messages from the PWA. Upon receiving the message to start the\nverification process,\n\n1. Call the Verified Access API to create a challenge\n2. Call the enterprise.platformKeys API on the generated challenge to create a challenge-response with an Enterprise User Key (user the `\"USER\"` scope)\n3. Send a request with the challenge-response to the network service to be verified\n\nRefer to the [developer guide](/chrome/verified-access/developer-guide)\nfor more information and code samples.\n\n### Network service\n\nWhen your network service receives the request from the extension to verify the\nchallenge-response, use the\n[verify](/chrome/verified-access/reference/rest/v2/challenge/verify) method. For\nkiosk mode detection, set `expectedIdentity` to `\"KIOSK_MODE\"`. If successful,\nyou should see a response body of an empty string or empty JSON, meaning the\ndevice is in kiosk mode. If the device is not in kiosk mode, a 404 code is\nreturned in the response body with error message\n`\"Requested entity was not found\"`."]]