curl --request POST \
--url https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/beginimport requests
url = "https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin', 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://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin",
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://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin"
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://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin")
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{
"challenge_token": "string",
"secret": "string",
"otpauth_uri": "string",
"qr_code_png_base64": "string",
"expires_in": 0
}"string""string"Post apiv1tokenstwo factorenrolltotpbegin
curl --request POST \
--url https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/beginimport requests
url = "https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin', 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://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin",
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://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin"
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://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.outseta.com/api/v1/tokens/two-factor/enroll/totp/begin")
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{
"challenge_token": "string",
"secret": "string",
"otpauth_uri": "string",
"qr_code_png_base64": "string",
"expires_in": 0
}"string""string"Query Parameters
Response
The shared secret and enrollment-test challenge are returned.
Returned from POST /api/v1/tokens/two-factor/enroll/totp/begin when a user forced into 2FA chooses to enroll an authenticator app. Carries the shared secret in the three forms a client may need to present it, plus the challenge token the user's first generated code is confirmed against. The property names are snake_case to match the wire format of the other token endpoints (see TokenPayload).
Short-lived signed JWT identifying the enrollment-test challenge. Echo it back to POST /api/v1/tokens/two-factor/enroll/totp/confirm along with the first code from the authenticator app.
The Base32-encoded shared secret. Offer this for manual entry by users who cannot scan the QR code.
The full otpauth://totp/... URI encoding the secret, issuer and parameters. Most authenticator apps add an account directly from this.
A QR code rendering of otpauth_uri as a PNG, Base64 encoded — render it as an [Image blocked: No description] for the user to scan.
Seconds until the enrollment-test challenge expires (600).