Organization SSO
Sign in with invitation SSO
Returns an authentication URL for the organization SSO connection associated with the supplied invitation token. Supply token and returnTo. Complete the returned authentication flow; requesting its URL does not itself accept the invitation.
POST
/
v1
/
auth
/
organizations
/
{orgId}
/
sso
/
invitation
Sign in with invitation SSO
curl --request POST \
--url https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation \
--header 'Content-Type: application/json' \
--cookie wos-session= \
--data '
{
"returnTo": "<string>",
"token": "<string>"
}
'import requests
url = "https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation"
payload = {
"returnTo": "<string>",
"token": "<string>"
}
headers = {
"cookie": "wos-session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'wos-session=', 'Content-Type': 'application/json'},
body: JSON.stringify({returnTo: '<string>', token: '<string>'})
};
fetch('https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation', 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.photon.codes/v1/auth/organizations/{orgId}/sso/invitation",
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([
'returnTo' => '<string>',
'token' => '<string>'
]),
CURLOPT_COOKIE => "wos-session=",
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://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation"
payload := strings.NewReader("{\n \"returnTo\": \"<string>\",\n \"token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "wos-session=")
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://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation")
.header("cookie", "wos-session=")
.header("Content-Type", "application/json")
.body("{\n \"returnTo\": \"<string>\",\n \"token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'wos-session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"returnTo\": \"<string>\",\n \"token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>"
}{
"code": "INVALID_RETURN_TO",
"status": 400,
"title": "Invalid Return To",
"type": "https://photon.codes/docs/problems/invalid-return-to"
}{
"code": "ORGANIZATION_SSO_NOT_FOUND",
"status": 404,
"title": "Organization SSO Not Found",
"type": "https://photon.codes/docs/problems/organization-sso-not-found"
}{
"code": "ORGANIZATION_SSO_CONFLICT",
"status": 409,
"title": "Organization SSO Conflict",
"type": "https://photon.codes/docs/problems/organization-sso-conflict"
}{
"code": "ORGANIZATION_SSO_PRECONDITION_FAILED",
"status": 412,
"title": "Organization SSO Precondition Failed",
"type": "https://photon.codes/docs/problems/organization-sso-precondition-failed"
}{
"code": "VALIDATION_FAILED",
"issues": [
{
"code": "invalid_type",
"location": "json",
"message": "Expected a string.",
"path": "/name"
}
],
"status": 422,
"title": "Request Validation Failed",
"type": "https://photon.codes/docs/problems/validation-failed"
}{
"code": "INVALID_AUTH_CONTEXT",
"status": 500,
"title": "Invalid Authentication Context",
"type": "https://photon.codes/docs/problems/invalid-auth-context"
}{
"code": "UPSTREAM_FAILURE",
"status": 502,
"title": "Upstream Service Failure",
"type": "https://photon.codes/docs/problems/upstream-failure"
}{
"code": "UPSTREAM_UNAVAILABLE",
"status": 503,
"title": "Upstream Service Unavailable",
"type": "https://photon.codes/docs/problems/upstream-unavailable"
}{
"code": "UPSTREAM_TIMEOUT",
"status": 504,
"title": "Upstream Service Timeout",
"type": "https://photon.codes/docs/problems/upstream-timeout"
}Authorizations
Dashboard browser session, sent automatically by the browser. Only the dashboard origin runs the session adapter that exchanges it for an access token, so this is declared for documents served there and is not accepted on the public API origin. No requirement preset lists it.
Path Parameters
Pattern:
^pho_org_[0-7][0-9a-hjkmnp-tv-z]{25}$Body
application/json
Response
Invitation-bound SSO authorization URL.
Was this page helpful?
⌘I
Sign in with invitation SSO
curl --request POST \
--url https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation \
--header 'Content-Type: application/json' \
--cookie wos-session= \
--data '
{
"returnTo": "<string>",
"token": "<string>"
}
'import requests
url = "https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation"
payload = {
"returnTo": "<string>",
"token": "<string>"
}
headers = {
"cookie": "wos-session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'wos-session=', 'Content-Type': 'application/json'},
body: JSON.stringify({returnTo: '<string>', token: '<string>'})
};
fetch('https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation', 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.photon.codes/v1/auth/organizations/{orgId}/sso/invitation",
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([
'returnTo' => '<string>',
'token' => '<string>'
]),
CURLOPT_COOKIE => "wos-session=",
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://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation"
payload := strings.NewReader("{\n \"returnTo\": \"<string>\",\n \"token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "wos-session=")
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://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation")
.header("cookie", "wos-session=")
.header("Content-Type", "application/json")
.body("{\n \"returnTo\": \"<string>\",\n \"token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.photon.codes/v1/auth/organizations/{orgId}/sso/invitation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'wos-session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"returnTo\": \"<string>\",\n \"token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": "<string>"
}{
"code": "INVALID_RETURN_TO",
"status": 400,
"title": "Invalid Return To",
"type": "https://photon.codes/docs/problems/invalid-return-to"
}{
"code": "ORGANIZATION_SSO_NOT_FOUND",
"status": 404,
"title": "Organization SSO Not Found",
"type": "https://photon.codes/docs/problems/organization-sso-not-found"
}{
"code": "ORGANIZATION_SSO_CONFLICT",
"status": 409,
"title": "Organization SSO Conflict",
"type": "https://photon.codes/docs/problems/organization-sso-conflict"
}{
"code": "ORGANIZATION_SSO_PRECONDITION_FAILED",
"status": 412,
"title": "Organization SSO Precondition Failed",
"type": "https://photon.codes/docs/problems/organization-sso-precondition-failed"
}{
"code": "VALIDATION_FAILED",
"issues": [
{
"code": "invalid_type",
"location": "json",
"message": "Expected a string.",
"path": "/name"
}
],
"status": 422,
"title": "Request Validation Failed",
"type": "https://photon.codes/docs/problems/validation-failed"
}{
"code": "INVALID_AUTH_CONTEXT",
"status": 500,
"title": "Invalid Authentication Context",
"type": "https://photon.codes/docs/problems/invalid-auth-context"
}{
"code": "UPSTREAM_FAILURE",
"status": 502,
"title": "Upstream Service Failure",
"type": "https://photon.codes/docs/problems/upstream-failure"
}{
"code": "UPSTREAM_UNAVAILABLE",
"status": 503,
"title": "Upstream Service Unavailable",
"type": "https://photon.codes/docs/problems/upstream-unavailable"
}{
"code": "UPSTREAM_TIMEOUT",
"status": 504,
"title": "Upstream Service Timeout",
"type": "https://photon.codes/docs/problems/upstream-timeout"
}