в документе: «Нативные пассажиры на ios 15.0+ и api Api 28+ < /strong> < /press>». class = "Snippet-Code">
Код: Выделить всё
async function createAccount() {
//generate a challenge from backend
try {
const requestJson = {
'challenge': 'T1xCsnxM2DNL2KdK5CLa6fMhD7OBqho6syzInk_n-Uo',
'rp': {
'name': 'Passkey',
'id': 'com.myapp',
},
'user': {
'id': 'user123',
'name': 'john.doe@example.coms',
'displayName': 'john Does',
},
'pubKeyCredParams': [
{
'type': 'public-key',
'alg': -7,
},
],
'authenticatorSelection': {
'authenticatorAttachment': 'platform',
'requireResidentKey': true,
'userVerification': 'preferred',
},
'timeout': 60000,
'attestation': 'direct',
};
const result = await Passkey.create(requestJson);
console.log('Registration result: ', result);
} catch (e) {
console.log('Registration result:',e);
}
}< /code>
< /div>
< /div>
< /p>
Я тестировал на 3 устройствах.
1 -й Android 14, это может < /strong> создать пас -ключ, как и ожидалось. Входящий запрос не может быть подтвержден "} Подробнее здесь: https://stackoverflow.com/questions/792 ... native-app