Create or update OAuth server config
Enable and configure your application as an OAuth 2.0 authorization
server. The presence of the registration.dcr and
registration.cimd objects enables Dynamic Client Registration
(RFC 7591) and Client ID Metadata Documents respectively; omit one to
leave that mechanism disabled.
curl --request PUT \
--url https://api.prelude.dev/v2/session/apps/{appID}/oauth \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"default_provider_url": "<string>",
"registration": {
"redirect_uri_allowlist": [
"<string>"
],
"dcr": {
"default_scopes": [
"<string>"
],
"auto_registered_client_ttl_seconds": 123
},
"cimd": {
"client_url_allowlist": [
"<string>"
],
"default_scopes": [
"<string>"
],
"cache_ttl_seconds": 123
}
}
}
'import requests
url = "https://api.prelude.dev/v2/session/apps/{appID}/oauth"
payload = {
"default_provider_url": "<string>",
"registration": {
"redirect_uri_allowlist": ["<string>"],
"dcr": {
"default_scopes": ["<string>"],
"auto_registered_client_ttl_seconds": 123
},
"cimd": {
"client_url_allowlist": ["<string>"],
"default_scopes": ["<string>"],
"cache_ttl_seconds": 123
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
default_provider_url: '<string>',
registration: {
redirect_uri_allowlist: ['<string>'],
dcr: {default_scopes: ['<string>'], auto_registered_client_ttl_seconds: 123},
cimd: {
client_url_allowlist: ['<string>'],
default_scopes: ['<string>'],
cache_ttl_seconds: 123
}
}
})
};
fetch('https://api.prelude.dev/v2/session/apps/{appID}/oauth', 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.prelude.dev/v2/session/apps/{appID}/oauth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'default_provider_url' => '<string>',
'registration' => [
'redirect_uri_allowlist' => [
'<string>'
],
'dcr' => [
'default_scopes' => [
'<string>'
],
'auto_registered_client_ttl_seconds' => 123
],
'cimd' => [
'client_url_allowlist' => [
'<string>'
],
'default_scopes' => [
'<string>'
],
'cache_ttl_seconds' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.prelude.dev/v2/session/apps/{appID}/oauth"
payload := strings.NewReader("{\n \"default_provider_url\": \"<string>\",\n \"registration\": {\n \"redirect_uri_allowlist\": [\n \"<string>\"\n ],\n \"dcr\": {\n \"default_scopes\": [\n \"<string>\"\n ],\n \"auto_registered_client_ttl_seconds\": 123\n },\n \"cimd\": {\n \"client_url_allowlist\": [\n \"<string>\"\n ],\n \"default_scopes\": [\n \"<string>\"\n ],\n \"cache_ttl_seconds\": 123\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.prelude.dev/v2/session/apps/{appID}/oauth")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"default_provider_url\": \"<string>\",\n \"registration\": {\n \"redirect_uri_allowlist\": [\n \"<string>\"\n ],\n \"dcr\": {\n \"default_scopes\": [\n \"<string>\"\n ],\n \"auto_registered_client_ttl_seconds\": 123\n },\n \"cimd\": {\n \"client_url_allowlist\": [\n \"<string>\"\n ],\n \"default_scopes\": [\n \"<string>\"\n ],\n \"cache_ttl_seconds\": 123\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prelude.dev/v2/session/apps/{appID}/oauth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"default_provider_url\": \"<string>\",\n \"registration\": {\n \"redirect_uri_allowlist\": [\n \"<string>\"\n ],\n \"dcr\": {\n \"default_scopes\": [\n \"<string>\"\n ],\n \"auto_registered_client_ttl_seconds\": 123\n },\n \"cimd\": {\n \"client_url_allowlist\": [\n \"<string>\"\n ],\n \"default_scopes\": [\n \"<string>\"\n ],\n \"cache_ttl_seconds\": 123\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"default_provider_url": "<string>",
"registration": {
"redirect_uri_allowlist": [
"<string>"
],
"dcr": {
"default_scopes": [
"<string>"
],
"auto_registered_client_ttl_seconds": 123
},
"cimd": {
"client_url_allowlist": [
"<string>"
],
"default_scopes": [
"<string>"
],
"cache_ttl_seconds": 123
}
},
"updated_at": 123
}{
"code": "invalid_oauth_server_config",
"status": "bad_request",
"message": "<string>"
}{
"code": "app_not_found",
"status": "not_found",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The id of the app the request refers to. An application's unique identifier.
"54e9ujn"
"fvua38g"
Body
Origin of your login UI. The server redirects the browser to <default_provider_url>/sign-in from /authorize and to <default_provider_url>/oauth/consent after login. Must be an absolute http(s) URL.
"https://auth.example.com"
How third-party clients come to exist, and the settings they share.
Show child attributes
Show child attributes
curl --request PUT \
--url https://api.prelude.dev/v2/session/apps/{appID}/oauth \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"default_provider_url": "<string>",
"registration": {
"redirect_uri_allowlist": [
"<string>"
],
"dcr": {
"default_scopes": [
"<string>"
],
"auto_registered_client_ttl_seconds": 123
},
"cimd": {
"client_url_allowlist": [
"<string>"
],
"default_scopes": [
"<string>"
],
"cache_ttl_seconds": 123
}
}
}
'import requests
url = "https://api.prelude.dev/v2/session/apps/{appID}/oauth"
payload = {
"default_provider_url": "<string>",
"registration": {
"redirect_uri_allowlist": ["<string>"],
"dcr": {
"default_scopes": ["<string>"],
"auto_registered_client_ttl_seconds": 123
},
"cimd": {
"client_url_allowlist": ["<string>"],
"default_scopes": ["<string>"],
"cache_ttl_seconds": 123
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
default_provider_url: '<string>',
registration: {
redirect_uri_allowlist: ['<string>'],
dcr: {default_scopes: ['<string>'], auto_registered_client_ttl_seconds: 123},
cimd: {
client_url_allowlist: ['<string>'],
default_scopes: ['<string>'],
cache_ttl_seconds: 123
}
}
})
};
fetch('https://api.prelude.dev/v2/session/apps/{appID}/oauth', 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.prelude.dev/v2/session/apps/{appID}/oauth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'default_provider_url' => '<string>',
'registration' => [
'redirect_uri_allowlist' => [
'<string>'
],
'dcr' => [
'default_scopes' => [
'<string>'
],
'auto_registered_client_ttl_seconds' => 123
],
'cimd' => [
'client_url_allowlist' => [
'<string>'
],
'default_scopes' => [
'<string>'
],
'cache_ttl_seconds' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.prelude.dev/v2/session/apps/{appID}/oauth"
payload := strings.NewReader("{\n \"default_provider_url\": \"<string>\",\n \"registration\": {\n \"redirect_uri_allowlist\": [\n \"<string>\"\n ],\n \"dcr\": {\n \"default_scopes\": [\n \"<string>\"\n ],\n \"auto_registered_client_ttl_seconds\": 123\n },\n \"cimd\": {\n \"client_url_allowlist\": [\n \"<string>\"\n ],\n \"default_scopes\": [\n \"<string>\"\n ],\n \"cache_ttl_seconds\": 123\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.prelude.dev/v2/session/apps/{appID}/oauth")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"default_provider_url\": \"<string>\",\n \"registration\": {\n \"redirect_uri_allowlist\": [\n \"<string>\"\n ],\n \"dcr\": {\n \"default_scopes\": [\n \"<string>\"\n ],\n \"auto_registered_client_ttl_seconds\": 123\n },\n \"cimd\": {\n \"client_url_allowlist\": [\n \"<string>\"\n ],\n \"default_scopes\": [\n \"<string>\"\n ],\n \"cache_ttl_seconds\": 123\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prelude.dev/v2/session/apps/{appID}/oauth")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"default_provider_url\": \"<string>\",\n \"registration\": {\n \"redirect_uri_allowlist\": [\n \"<string>\"\n ],\n \"dcr\": {\n \"default_scopes\": [\n \"<string>\"\n ],\n \"auto_registered_client_ttl_seconds\": 123\n },\n \"cimd\": {\n \"client_url_allowlist\": [\n \"<string>\"\n ],\n \"default_scopes\": [\n \"<string>\"\n ],\n \"cache_ttl_seconds\": 123\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"default_provider_url": "<string>",
"registration": {
"redirect_uri_allowlist": [
"<string>"
],
"dcr": {
"default_scopes": [
"<string>"
],
"auto_registered_client_ttl_seconds": 123
},
"cimd": {
"client_url_allowlist": [
"<string>"
],
"default_scopes": [
"<string>"
],
"cache_ttl_seconds": 123
}
},
"updated_at": 123
}{
"code": "invalid_oauth_server_config",
"status": "bad_request",
"message": "<string>"
}{
"code": "app_not_found",
"status": "not_found",
"message": "<string>"
}