Login with Auth0.
curl --request POST \
--url https://api.coinfer.ai/base/auth0-loginimport requests
url = "https://api.coinfer.ai/base/auth0-login"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.coinfer.ai/base/auth0-login', 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://api.coinfer.ai/base/auth0-login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinfer.ai/base/auth0-login"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coinfer.ai/base/auth0-login")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinfer.ai/base/auth0-login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"tokens": [
"<string>"
]
}
}Authorization
Login with Auth0.
This API should be called after the user finishes the Auth0 authorization.
So the frontend should be able to obtain an Auth0 token at that point. The
API should be called with this token in the Authorization header, in the
format like Authorization: Bearer <token>.
The API will call an Auth0 API to query user information with the token. If it successfully gets it, it means the token is valid. Then the API will either:
- Retrieve the user object within our system
- Create a new user within our system
depending on whether a user with the same identity exists in our system.
If everything is okay, the API will return a token which can then be used as an identification to call other APIs. The return format is intentionally designed to keep the same as password login API.
POST
/
base
/
auth0-login
Login with Auth0.
curl --request POST \
--url https://api.coinfer.ai/base/auth0-loginimport requests
url = "https://api.coinfer.ai/base/auth0-login"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.coinfer.ai/base/auth0-login', 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://api.coinfer.ai/base/auth0-login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinfer.ai/base/auth0-login"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coinfer.ai/base/auth0-login")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinfer.ai/base/auth0-login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"tokens": [
"<string>"
]
}
}