보조 사용자 인증을 사용하면 음성 명령에 2단계 보안을 추가할 수 있습니다. 이렇게 하면 보안 카메라 끄기, 문 열기 등의 특정 작업에 추가 보안을 적용할 수 있습니다. 보조 사용자 인증은 특정 기기 특성에 종속되지 않으므로 개발자는 Google Assistant issue a challenge. For example, you can choose to issue a challenge for the OnOff trait for a security camera, but not issue a challenge for the OnOff trait for a light. You can also have Assistant issue challenges in certain situations for the same action. For example, you can request that Assistant issue a challenge request to open a door if an NFC keyfob is not in the proximity of that door, but not issue a challenge if the keyfob is present.를 언제 사용할지 결정할 수 있습니다.
Assistant는 명시적 승인 또는 개인 식별 번호 (PIN)와 같은 두 가지 유형의 본인 확인 요청을 발급할 수 있습니다. 그러면 Assistant에서 작업으로 다시 전송된 QUERY
및 EXECUTE
인텐트에 챌린지 블록이 추가되고 challengeNeeded
오류 응답이 허용됩니다.
그러면 Assistant가 챌린지 블록의 챌린지 데이터와 함께 인텐트 요청을 작업에 다시 보냅니다. 그러면 챌린지 데이터를 검증하여 사용자가 올바른 보안 응답을 제공했는지 확인할 수 있습니다.
Assistant는 대화상자를 사용하여 챌린지를 진행하지만 비음성 노출 영역에서 Assistant를 사용하면 화면에서 PIN과 확인이 완료됩니다.
지원되는 기기 유형
보조 사용자 인증은 모든 기기 유형에서 지원됩니다.
지원되는 기기 특성
보조 사용자 인증은 모든 기기 특성에서 지원됩니다.
지원되는 챌린지 유형
지원되는 보조 사용자 확인 요청 유형은 다음과 같습니다.
- 본인 확인 요청 없음 - 보조 사용자 확인 질문을 사용하지 않는 요청 및 응답.
- ackNeeded - 명시적인 확인 (예 또는 아니요)이 필요하고 특성 상태를 응답 피드백으로 사용할 수 있는 보조 사용자 확인 이 챌린지 유형은 보안 기기 및 특성에 권장되지 않습니다.
- pinNeeded - 보안 기기 및 특성에 이상적인 개인 식별 번호 (PIN)가 필요한 보조 사용자 인증입니다.
챌린지 없음
이 예에서는 조명을 켜는 챌린지 없이 성공한 EXECUTE
요청과 응답을 보여줍니다.
사용자 | 조명을 켭니다. |
Google Assistant | 알겠습니다. 조명을 3개 켭니다. |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.OnOff", "params": { "on": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "SUCCESS", "states": { "on": true, "online": true } }] } }
확인 필요
특성 또는 간단한 확인 인증에 여러 상태를 사용할 수 있는 보조 사용자 확인 인증.
ackNeeded
챌린지 유형에는 다음과 같은 유형이 있습니다.
ackNeeded
이 예에서는 ackNeeded
조명을 사용하여 밝기를 낮추기 위한 확인 요청 및 응답을 보여줍니다.
사용자 | 거실 조명을 어둡게 해줘. |
Google Assistant | 거실 조명 어둡게 해 줘. 계속하시겠습니까? |
사용자 | 예, 가능합니다. |
Google Assistant | 거실 조명 어둡게 해 줘. |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.BrightnessAbsolute", "params": { "brightness": 12 } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "ERROR", "errorCode": "challengeNeeded", "challengeNeeded": { "type": "ackNeeded" } }] } }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.BrightnessAbsolute", "params": { "brightness": 12 }, "challenge": { "ack": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "SUCCESS" }] } }
ackNeeded 특성 상태
특성의 상태를 사용할 수 있는 보조 사용자 확인 인증.
예를 들어 TemperatureSetting 특성으로 작업할 때 thermostatMode
및 thermostatTemperatureSetpoint
가 모두 설정된 경우 Assistant가 에어컨의 난방을 28도로 설정하시겠습니까?라고 질문할 수 있습니다.
응답에 상태를 포함하여 Assistant이 지정된 요청에 따라 특정 작업을 실행하도록 할 수도 있습니다.
다음 특성 및 상태는 특성 상태로 ackNeeded
를 지원합니다. 특정 특성의 목록은 해당 상태가 모두 지원됨을 나타냅니다.
- ArmDisarm
currentArmLevel
currentStatusReport
- 채우기
- 잠금 해제
- 사용 중지
on
- OpenClose
- 장면
- 기온 설정
thermostatMode
thermostatTemperatureSetpoint
thermostatTemperatureSetpointHigh
thermostatTemperatureSetpointLow
이 예에서는 특성 상태를 사용하는 ackNeeded
챌린지가 포함된 요청 및 응답을 보여줍니다. 에어컨 모드를 난방으로 변경하고 온도를 28도로 설정합니다. 그런 다음 28
가 thermostatTemperatureSetpoint
를 응답에서 반환하므로 Assistant는 사용자에게 열을 켜고 28도로 설정하라는 확인을 요청합니다.
사용자 | 난방 모드를 난방 모드로 설정합니다. |
Google Assistant | 에어컨 난방을 28도로 설정할까요? |
사용자 | 예, 가능합니다. |
Google Assistant | 에어컨 난방을 28도로 설정합니다. |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.TemperatureSetting", "params": { "thermostatMode": "heat" } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "ERROR", "states": { "thermostatMode": "heat", "thermostatTemperatureSetpoint": 28 }, "errorCode": "challengeNeeded", "challengeNeeded": { "type": "ackNeeded" } }] } }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.TemperatureSetting", "params": { "thermostatMode": "heat" }, "challenge": { "ack": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "SUCCESS", "states": { "thermostatMode": "heat", "thermostatTemperatureSetpoint": 28 } }] } }
PIN 필요
보안 기기에는 pinNeeded
본인 확인을 요청하는 것이 좋습니다.
이 예에서는 pinNeeded
요청 시 초기 요청 및 응답을 보여줍니다. 이 예에서는 pinNeeded
본인 확인 요청에 대한 응답을 반환하므로 Assistant는 핀을 요청합니다. 이 시점에서 사용자는 잘못되거나 유효한 핀을 제공할 수 있습니다.
잘못되거나 유효한 PIN에 대한 요청 및 응답 샘플:
사용자 | 문을 잠금 해제하세요. |
Google Assistant | 보안 코드를 알려 주시겠어요? |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.LockUnlock", "params": { "lock": false } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "ERROR", "errorCode": "challengeNeeded", "challengeNeeded": { "type": "pinNeeded" } }] } }
잘못된 PIN
이 예에서는 challengeFailedPinNeeded
챌린지를 사용하는 요청 및 응답을 보여줍니다. 이 챌린지는 초기 pinNeeded
챌린지가 실패한 후 사용해야 합니다.
challengeFailedPinNeeded
유형이 반환되면 Assistant는 보안 코드를 다시 요청합니다. 사용자가 실패한 시도를 너무 많이 수행하면 tooManyFailedAttempts
오류 응답을 반환할 수 있습니다. 오류 응답을 참고하세요.
사용자 | 333222 |
Google Assistant | 죄송합니다. 보안 코드가 잘못되었습니다. 보안 코드를 알려 주시겠어요? |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.LockUnlock", "params": { "lock": false }, "challenge": { "pin": "333222" } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "ERROR", "errorCode": "challengeNeeded", "challengeNeeded": { "type": "challengeFailedPinNeeded" } }] } }
유효한 PIN
이 예시에서는 유효한 PIN의 요청 및 응답을 보여줍니다.
사용자 | 333444 |
Google Assistant | 문 잠금을 해제합니다. |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.LockUnlock", "params": { "lock": false }, "challenge": { "pin": "333444" } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "SUCCESS", "states": { "isLocked": false, "isJammed": false } }] } }
사용자 | 거실 조명을 어둡게 해줘. |
Google Assistant | 보안 코드를 알려 주시겠어요? |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.BrightnessAbsolute", "params": { "brightness": 12 } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["123"], "status": "ERROR", "errorCode": "challengeNeeded", "challengeNeeded": { "type": "pinNeeded" } }] } }
오류 응답
응답과 함께 반환될 수 있는 오류 코드는 다음과 같습니다.
challengeFailedNotSetup
- 이 작업에는 보안 코드가 필요하지만 기기의 앱에서 설정되지 않았습니다.tooManyFailedAttempts
- 실패한 시도 횟수가 너무 많습니다. 기기의 앱으로 이동하여 작업을 완료하세요.pinIncorrect
- 죄송합니다. 보안 코드가 잘못되었습니다.userCancelled
: 확인
오류 및 예외의 전체 목록을 참조하세요.