User Auth
Authenticate user with signed data
Verifies wallet signature and issues session tokens
POST
/
v0
/
auth
/
authenticate
Authenticate user with signed data
curl --request POST \
--url https://1click.chaindefuser.com/v0/auth/authenticate \
--header 'Content-Type: application/json' \
--data '
{
"signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
}
}
'import requests
url = "https://1click.chaindefuser.com/v0/auth/authenticate"
payload = { "signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
signedData: {
payload: {
message: '<string>',
nonce: '<string>',
recipient: '<string>',
callbackUrl: '<string>'
},
public_key: '<string>',
signature: '<string>',
standard: 'nep413'
}
})
};
fetch('https://1click.chaindefuser.com/v0/auth/authenticate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://1click.chaindefuser.com/v0/auth/authenticate",
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([
'signedData' => [
'payload' => [
'message' => '<string>',
'nonce' => '<string>',
'recipient' => '<string>',
'callbackUrl' => '<string>'
],
'public_key' => '<string>',
'signature' => '<string>',
'standard' => 'nep413'
]
]),
CURLOPT_HTTPHEADER => [
"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://1click.chaindefuser.com/v0/auth/authenticate"
payload := strings.NewReader("{\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://1click.chaindefuser.com/v0/auth/authenticate")
.header("Content-Type", "application/json")
.body("{\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1click.chaindefuser.com/v0/auth/authenticate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"refreshToken": "<string>",
"expiresIn": 123,
"refreshExpiresIn": 123
}Body
application/json
Assuming wallets want to interact with Intents protocol, besides preparing the data in a certain form, they have to have the capability to sign raw messages (off-chain signatures) using an algorithm we understand. This enum solves that problem.
For example, because we support ERC-191 and know how to verify messages with that standard, we can allow wallets, like Metamask, sign messages to perform intents without having to support new cryptographic primitives and signing standards.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Authenticate user with signed data
curl --request POST \
--url https://1click.chaindefuser.com/v0/auth/authenticate \
--header 'Content-Type: application/json' \
--data '
{
"signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
}
}
'import requests
url = "https://1click.chaindefuser.com/v0/auth/authenticate"
payload = { "signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
signedData: {
payload: {
message: '<string>',
nonce: '<string>',
recipient: '<string>',
callbackUrl: '<string>'
},
public_key: '<string>',
signature: '<string>',
standard: 'nep413'
}
})
};
fetch('https://1click.chaindefuser.com/v0/auth/authenticate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://1click.chaindefuser.com/v0/auth/authenticate",
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([
'signedData' => [
'payload' => [
'message' => '<string>',
'nonce' => '<string>',
'recipient' => '<string>',
'callbackUrl' => '<string>'
],
'public_key' => '<string>',
'signature' => '<string>',
'standard' => 'nep413'
]
]),
CURLOPT_HTTPHEADER => [
"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://1click.chaindefuser.com/v0/auth/authenticate"
payload := strings.NewReader("{\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://1click.chaindefuser.com/v0/auth/authenticate")
.header("Content-Type", "application/json")
.body("{\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1click.chaindefuser.com/v0/auth/authenticate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"refreshToken": "<string>",
"expiresIn": 123,
"refreshExpiresIn": 123
}