Factor Resource
The Passkey Factor resource is currently used by Passkeys. This factor is different than the Factor resource used for Push and TOTP verification and its properties apply to Passkeys only. A single Entity links to multiple Passkey Factors and TOTP/Push Factors.
Info
For security reasons the options property is ONLY returned when the resource is created and is never returned in later requests.
Info
In the request, if the specified Entity with the {identity} path parameter doesn't exist, it will be created automatically. You don't need to create a new Entity separately before making this request.
A 34 character string that uniquely identifies this Factor.
^YF[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Service.
^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34The unique SID identifier of the Entity.
^YE[0-9a-fA-F]{32}$Min length: 34Max length: 34Contains the factor_type specific secret and metadata. The Binding property is ONLY returned upon Factor creation.
The date that this Factor was created, given in ISO 8601 format.
The date that this Factor was updated, given in ISO 8601 format.
The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.
The Status of this Factor. One of unverified or verified.
unverifiedverifiedThe Type of this Factor. Currently push and totp are supported.
pushtotppasskeysThe URL of this resource.
POST https://verify.twilio.com/v2/Services/{ServiceSid}/Passkeys/Factors
The unique SID identifier of the Service.
^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34application/json1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createNewFactorPasskey() {11const newFactor = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.newFactors.create({14friendly_name: "friendly_name",15identity: "identity",16});1718console.log(newFactor.sid);19}2021createNewFactorPasskey();
Response
1{2"sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"identity": "identity",7"binding": null,8"date_created": "2015-07-30T20:00:00Z",9"date_updated": "2015-07-30T20:00:00Z",10"friendly_name": "friendly_name",11"status": "unverified",12"factor_type": "passkeys",13"config": {14"relying_party": {15"id": "example.com",16"name": "Example",17"origins": [18"https://example.com"19]20},21"authenticator_attachment": "platform",22"discoverable_credentials": "preferred",23"user_verification": "preferred"24},25"options": {26"publicKey": {27"rp": {28"id": "example.com",29"name": "Example"30},31"user": {32"id": "WUU0ZmQzYWFmNGU0NTMyNGQwZjNlMTM0NjA3YjIxOTEyYg",33"name": "friendly_name",34"displayName": "friendly_name"35},36"challenge": "WUYwNDhkMWE3ZWMzYTJhNjk3MDA1OWMyNzY2YmJjN2UwZg",37"pubKeyCredParams": {38"type": "public-key",39"alg": -740},41"timeout": 600000,42"excludeCredentials": [],43"authenticatorSelection": {44"authenticatorAttachment": "platform",45"requireResidentKey": false,46"residentKey": "preferred",47"userVerification": "preferred"48},49"attestation": "none"50}51},52"metadata": null,53"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"54}
POST https://verify.twilio.com/v2/Services/{ServiceSid}/Passkeys/VerifyFactor
The unique SID identifier of the Service.
^VA[0-9a-fA-F]{32}$Min length: 34Max length: 34application/jsonA string that indicates the mechanism by which the WebAuthn implementation is attached to the authenticator at the time the associated
navigator.credentials.create() or navigator.credentials.get() call completes.
platformcross-platformThe valid credential types supported by the API.
The values of this enumeration are used for versioning the AuthenticatorAssertion and AuthenticatorAttestation structures according to the type of the authenticator.
public-keyPossible values: public-keyThe result of a WebAuthn credential registration via navigator.credentials.create(), as specified in AuthenticatorAttestationResponse.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updatePasskeysFactor() {11const newVerifyFactor = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.newVerifyFactors.update({14response: {15attestationObject: "attestationObject",16clientDataJSON: "clientDataJSON",17transports: ["usb"],18},19});2021console.log(newVerifyFactor.sid);22}2324updatePasskeysFactor();
Response
1{2"sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"identity": "ff483d1ff591898a9942916050d2ca3f",7"date_created": "2015-07-30T20:00:00Z",8"date_updated": "2015-07-30T20:00:00Z",9"friendly_name": "friendly_name",10"status": "verified",11"factor_type": "passkeys",12"config": {13"relying_party": {14"id": "example.com",15"name": "Example",16"origins": [17"https://example.com"18]19},20"authenticator_attachment": "platform",21"discoverable_credentials": "preferred",22"user_verification": "preferred"23},24"metadata": null,25"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"26}