curl --request POST \
--url https://sandbox.circularo.com/api/v1/saml/callback \
--header 'Content-Type: application/json' \
--data '
{
"RelayState": "eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=",
"SAMLResponse": "PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."
}
'import requests
url = "https://sandbox.circularo.com/api/v1/saml/callback"
payload = {
"RelayState": "eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=",
"SAMLResponse": "PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."
}
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({
RelayState: 'eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=',
SAMLResponse: 'PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...'
})
};
fetch('https://sandbox.circularo.com/api/v1/saml/callback', 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://sandbox.circularo.com/api/v1/saml/callback",
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([
'RelayState' => 'eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=',
'SAMLResponse' => 'PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...'
]),
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://sandbox.circularo.com/api/v1/saml/callback"
payload := strings.NewReader("{\n \"RelayState\": \"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=\",\n \"SAMLResponse\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\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://sandbox.circularo.com/api/v1/saml/callback")
.header("Content-Type", "application/json")
.body("{\n \"RelayState\": \"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=\",\n \"SAMLResponse\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/saml/callback")
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 \"RelayState\": \"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=\",\n \"SAMLResponse\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n}"
response = http.request(request)
puts response.read_body{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 503,
"type": "SYSTEM:STATE_UPDATE_IN_PROGRESS",
"message": "System update in progress",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Finish a SAML sign-in
POST /saml/callback
The assertion consumer address identity providers are given when a sign-in is started with GET /saml, and the one the person’s browser posts back to once they have authenticated. It is reached by that form post, never called by a client on its own, and it always answers with a redirect rather than a body.
Where the browser ends up depends on how the sign-in was started. An ordinary one leaves the session token in a cookie good for thirty days and lands in the web application; one that named a callback address of its own leaves a one-time code there instead, to be exchanged through GET /saml/code. A sign-in that did not work out is sent back to the address it started from with the reason in an err parameter - as is one for somebody who has no account here and whose tenant does not allow accounts to be opened this way, since a tenant that does allow it has the account created on the spot from what the provider reported.
Where the provider was configured to post to a different address than the one the sign-in started from, the answer is passed on unchanged to that original address first, so that the session cookie is set on the site the person is actually using.
No authorization: No authorization is required to call this endpoint.
curl --request POST \
--url https://sandbox.circularo.com/api/v1/saml/callback \
--header 'Content-Type: application/json' \
--data '
{
"RelayState": "eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=",
"SAMLResponse": "PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."
}
'import requests
url = "https://sandbox.circularo.com/api/v1/saml/callback"
payload = {
"RelayState": "eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=",
"SAMLResponse": "PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."
}
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({
RelayState: 'eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=',
SAMLResponse: 'PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...'
})
};
fetch('https://sandbox.circularo.com/api/v1/saml/callback', 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://sandbox.circularo.com/api/v1/saml/callback",
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([
'RelayState' => 'eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=',
'SAMLResponse' => 'PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...'
]),
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://sandbox.circularo.com/api/v1/saml/callback"
payload := strings.NewReader("{\n \"RelayState\": \"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=\",\n \"SAMLResponse\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\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://sandbox.circularo.com/api/v1/saml/callback")
.header("Content-Type", "application/json")
.body("{\n \"RelayState\": \"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=\",\n \"SAMLResponse\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/saml/callback")
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 \"RelayState\": \"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0=\",\n \"SAMLResponse\": \"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46...\"\n}"
response = http.request(request)
puts response.read_body{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 503,
"type": "SYSTEM:STATE_UPDATE_IN_PROGRESS",
"message": "System update in progress",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Body
Handle of the sign-in, handed to the identity provider when it was started and returned unchanged. It is a base64-encoded record of which tenant, organization or group the sign-in belongs to, where the browser came from and where it is to finish, and everything here is decided from it.
"eyJ0ZW5hbnQiOiJkZW1vY29tcGFueSIsInR5cGUiOiJ0ZW5hbnQiLCJkb21haW4iOiJodHRwczovL2FwcC5jaXJjdWxhcm8uY29tIn0="
The identity provider's assertion about the person who has just authenticated, base64-encoded as the SAML POST binding prescribes. It is read and checked against the configuration the relay state points at; one that is missing, unsigned by the expected certificate, expired or about somebody this platform will not admit ends the sign-in with the reason handed back on the return address rather than as a failed request.
"PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."
Response
The sign-in is finished and the browser is redirected onwards - into the web application, to the client's own callback address, or back to where it started with an err parameter when it did not work out.