Exchange a completed SSO sign-in
curl --request POST \
--url https://api.glassmarkets.io/v1/sso/exchange/ \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"exchange_verifier": "<string>"
}
'import requests
url = "https://api.glassmarkets.io/v1/sso/exchange/"
payload = {
"code": "<string>",
"exchange_verifier": "<string>"
}
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({code: '<string>', exchange_verifier: '<string>'})
};
fetch('https://api.glassmarkets.io/v1/sso/exchange/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v1/sso/exchange/"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"exchange_verifier\": \"<string>\"\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://api.glassmarkets.io/v1/sso/exchange/")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"exchange_verifier\": \"<string>\"\n}")
.asString();{
"user": {
"username": "<string>",
"first_name": "<string>",
"id": 123,
"last_name": "<string>",
"email": "jsmith@example.com",
"is_staff": true,
"can_manage_tokenomics": true
},
"expiry": "2023-11-07T05:31:56Z",
"token": "<string>",
"csrf_token": "<string>"
}{
"code": [
"This field is required."
]
}{
"detail": "Request was throttled. Expected available in 42 seconds."
}Authentication
Exchange a completed SSO sign-in
Exchanges the one-time code from a completed SSO sign-in for a session. The session is set as an HttpOnly browser cookie, so this endpoint needs a trusted browser origin.
Exchange a completed SSO sign-in
curl --request POST \
--url https://api.glassmarkets.io/v1/sso/exchange/ \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"exchange_verifier": "<string>"
}
'import requests
url = "https://api.glassmarkets.io/v1/sso/exchange/"
payload = {
"code": "<string>",
"exchange_verifier": "<string>"
}
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({code: '<string>', exchange_verifier: '<string>'})
};
fetch('https://api.glassmarkets.io/v1/sso/exchange/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.glassmarkets.io/v1/sso/exchange/"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"exchange_verifier\": \"<string>\"\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://api.glassmarkets.io/v1/sso/exchange/")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"exchange_verifier\": \"<string>\"\n}")
.asString();{
"user": {
"username": "<string>",
"first_name": "<string>",
"id": 123,
"last_name": "<string>",
"email": "jsmith@example.com",
"is_staff": true,
"can_manage_tokenomics": true
},
"expiry": "2023-11-07T05:31:56Z",
"token": "<string>",
"csrf_token": "<string>"
}{
"code": [
"This field is required."
]
}{
"detail": "Request was throttled. Expected available in 42 seconds."
}
