Passer au contenu principal
POST
/
device-credentials
TypeScript
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.deviceCredentials.createPublicKey({
        deviceName: "device_name",
        type: "public_key",
        value: "value",
        deviceId: "device_id",
    });
}
main();
{
  "id": "dcr_0000000000000001"
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corps

device_name
string
requis

Name for this device easily recognized by owner.

Minimum string length: 1
type
enum<string>
requis

Type of credential. Must be public_key.

Options disponibles:
public_key
value
string
requis

Base64 encoded string containing the credential.

Minimum string length: 1
device_id
string
requis

Unique identifier for the device. Recommend using Android_ID on Android and identifierForVendor.

Maximum string length: 36
Pattern: ^[-A-Fa-f0-9]+$
client_id
string<client-id>

client_id of the client (application) this credential is for.

Réponse

Device credentials successfully created.

id
string
défaut:dcr_0000000000000001
requis

The credential's identifier