メインコンテンツへスキップ
POST
https://{tenantDomain}/api/v2
/
device-credentials
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.CreatePublicKeyDeviceCredentialRequestContent{
        DeviceName: "device_name",
        Type: management.DeviceCredentialPublicKeyTypeEnum(
            "public_key",
        ),
        Value: "value",
        DeviceId: "device_id",
    }
    client.DeviceCredentials.CreatePublicKey(
        context.TODO(),
        request,
    )
}
{
  "id": "dcr_0000000000000001"
}

承認

Authorization
string
header
必須

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

ボディ

device_id
string
必須

デバイスの一意の識別子。AndroidではAndroid_ID、iOSではidentifierForVendorの使用を推奨します。

Maximum string length: 36
Pattern: ^[-A-Fa-f0-9]+$
device_name
string
必須

所有者が簡単に認識できる、このデバイスの名前。

Minimum string length: 1
type
enum<string>
必須

認証情報の種類。public_key である必要があります。

利用可能なオプション:
public_key
value
string
必須

認証情報を含むBase64エンコード文字列。

Minimum string length: 1
client_id
string<client-id>

この認証情報の対象であるクライアント(アプリケーション)の client_id。

レスポンス

デバイス認証情報が正常に作成されました。

id
string
デフォルト:dcr_0000000000000001
必須

この認証情報の識別子