Exchange an IdP-initiated OIDC authorization code
curl --request POST \
--url https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_provider_type_id": "auth_provider_type_id",
"code": "code"
}
'import requests
url = "https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow"
payload = {
"auth_provider_type_id": "auth_provider_type_id",
"code": "code"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({auth_provider_type_id: 'auth_provider_type_id', code: 'code'})
};
fetch('https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow', 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.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow",
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([
'auth_provider_type_id' => 'auth_provider_type_id',
'code' => 'code'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow"
payload := strings.NewReader("{\n \"auth_provider_type_id\": \"auth_provider_type_id\",\n \"code\": \"code\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"auth_provider_type_id\": \"auth_provider_type_id\",\n \"code\": \"code\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auth_provider_type_id\": \"auth_provider_type_id\",\n \"code\": \"code\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"client_id": "<string>",
"expires_in": 123,
"identity_id": "<string>",
"person_id": "<string>",
"scopes": [
"BACKEND"
],
"type": "MANAGED"
}Authentication
Exchange an IdP-initiated OIDC authorization code
Validates an authorization code returned by an IdP-initiated OpenID Connect SSO flow and exchanges it for an Extole access token. Expert-only; most integrators use POST /v4/tokens instead.
POST
https://api.extole.io
/
v4
/
tokens
/
openid-connect
/
idp-initiated-authorization-code-flow
Exchange an IdP-initiated OIDC authorization code
curl --request POST \
--url https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"auth_provider_type_id": "auth_provider_type_id",
"code": "code"
}
'import requests
url = "https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow"
payload = {
"auth_provider_type_id": "auth_provider_type_id",
"code": "code"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({auth_provider_type_id: 'auth_provider_type_id', code: 'code'})
};
fetch('https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow', 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.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow",
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([
'auth_provider_type_id' => 'auth_provider_type_id',
'code' => 'code'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow"
payload := strings.NewReader("{\n \"auth_provider_type_id\": \"auth_provider_type_id\",\n \"code\": \"code\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"auth_provider_type_id\": \"auth_provider_type_id\",\n \"code\": \"code\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v4/tokens/openid-connect/idp-initiated-authorization-code-flow")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auth_provider_type_id\": \"auth_provider_type_id\",\n \"code\": \"code\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"client_id": "<string>",
"expires_in": 123,
"identity_id": "<string>",
"person_id": "<string>",
"scopes": [
"BACKEND"
],
"type": "MANAGED"
}Response
Successful response
Access-token metadata returned by POST /v4/tokens, POST /v4/tokens/openid-connect/authorization-code-flow, GET /v4/tokens, GET /v4/tokens/{token}, and PUT /v4/tokens/exchange/{token}. Pass access_token in the Authorization header (Bearer ...) on subsequent requests.
Authorization scopes granted to this token. Determines which API operations the token may invoke.
Authorization scopes granted to this token. Determines which API operations the token may invoke.
Available options:
BACKEND, CLIENT_ADMIN, CLIENT_REPORT_DOWNLOAD, CLIENT_SUPERUSER, ONE_TIME, PASSWORD_RESET, USER_SUPPORT, VIEWER Was this page helpful?
