TypeScript
import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.createSigningKey({
jwk: {
kty: "EC",
crv: "P-256",
alg: "ES256",
use: "sig",
x: "x",
y: "y",
},
device_identifier: "device_identifier",
});
}
main();
import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.createSigningKey({
jwk: {
kty: "EC",
crv: "P-256",
alg: "ES256",
use: "sig",
x: "x",
y: "y",
},
device_identifier: "device_identifier",
});
}
main();
curl --request POST \
--url https://{host}/me/v1/consent-signing-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jwk": {
"kty": "EC",
"crv": "P-256",
"alg": "ES256",
"use": "sig",
"x": "<string>",
"y": "<string>"
},
"device_identifier": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{host}/me/v1/consent-signing-keys"
payload = {
"jwk": {
"kty": "EC",
"crv": "P-256",
"alg": "ES256",
"use": "sig",
"x": "<string>",
"y": "<string>"
},
"device_identifier": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/consent-signing-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jwk' => [
'kty' => 'EC',
'crv' => 'P-256',
'alg' => 'ES256',
'use' => 'sig',
'x' => '<string>',
'y' => '<string>'
],
'device_identifier' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/me/v1/consent-signing-keys"
payload := strings.NewReader("{\n \"jwk\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"alg\": \"ES256\",\n \"use\": \"sig\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n },\n \"device_identifier\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/me/v1/consent-signing-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jwk\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"alg\": \"ES256\",\n \"use\": \"sig\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n },\n \"device_identifier\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/consent-signing-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jwk\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"alg\": \"ES256\",\n \"use\": \"sig\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n },\n \"device_identifier\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"kid": "csk_72jbvv7LfRKYp59gtRLtkn",
"jwk": {
"kty": "EC",
"crv": "P-256",
"alg": "ES256",
"use": "sig",
"x": "<string>",
"y": "<string>",
"kid": "<string>"
},
"device_identifier": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}同意の署名鍵を登録する
認証済みユーザーの同意の署名鍵を登録します。この鍵は、署名付き同意決定の検証に使用されます。公開鍵のみを提供します。対応する秘密鍵はデバイス外に出してはなりません。
POST
https://{host}/me/v1
/
consent-signing-keys
TypeScript
import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.createSigningKey({
jwk: {
kty: "EC",
crv: "P-256",
alg: "ES256",
use: "sig",
x: "x",
y: "y",
},
device_identifier: "device_identifier",
});
}
main();
import { MyAccountClient } from "@auth0/myaccount-js";
async function main() {
const client = new MyAccountClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.consents.createSigningKey({
jwk: {
kty: "EC",
crv: "P-256",
alg: "ES256",
use: "sig",
x: "x",
y: "y",
},
device_identifier: "device_identifier",
});
}
main();
curl --request POST \
--url https://{host}/me/v1/consent-signing-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jwk": {
"kty": "EC",
"crv": "P-256",
"alg": "ES256",
"use": "sig",
"x": "<string>",
"y": "<string>"
},
"device_identifier": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://{host}/me/v1/consent-signing-keys"
payload = {
"jwk": {
"kty": "EC",
"crv": "P-256",
"alg": "ES256",
"use": "sig",
"x": "<string>",
"y": "<string>"
},
"device_identifier": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/me/v1/consent-signing-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jwk' => [
'kty' => 'EC',
'crv' => 'P-256',
'alg' => 'ES256',
'use' => 'sig',
'x' => '<string>',
'y' => '<string>'
],
'device_identifier' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/me/v1/consent-signing-keys"
payload := strings.NewReader("{\n \"jwk\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"alg\": \"ES256\",\n \"use\": \"sig\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n },\n \"device_identifier\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/me/v1/consent-signing-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jwk\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"alg\": \"ES256\",\n \"use\": \"sig\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n },\n \"device_identifier\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/me/v1/consent-signing-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"jwk\": {\n \"kty\": \"EC\",\n \"crv\": \"P-256\",\n \"alg\": \"ES256\",\n \"use\": \"sig\",\n \"x\": \"<string>\",\n \"y\": \"<string>\"\n },\n \"device_identifier\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"kid": "csk_72jbvv7LfRKYp59gtRLtkn",
"jwk": {
"kty": "EC",
"crv": "P-256",
"alg": "ES256",
"use": "sig",
"x": "<string>",
"y": "<string>",
"kid": "<string>"
},
"device_identifier": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}{
"type": "<string>",
"status": 123,
"title": "<string>",
"detail": "<string>",
"validation_errors": [
{
"detail": "<string>",
"field": "<string>",
"pointer": "<string>",
"source": "<string>"
}
]
}ボディ
application/json
同意署名鍵を登録するためのリクエスト本文。
レスポンス
同意署名鍵が正常に登録されました
認証済みユーザーが登録した同意署名鍵。