Handle OIDC backchannel logout
POST
/api/v1/auth/oidc/backchannel-logout
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");curl_easy_setopt(hnd, CURLOPT_URL, "http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "logout_token=example");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout"), Content = new FormUrlEncodedContent(new Dictionary<string, string> { { "logout_token", "example" }, }),};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout"
payload := strings.NewReader("logout_token=example")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout")) .header("Content-Type", "application/x-www-form-urlencoded") .method("POST", HttpRequest.BodyPublishers.ofString("logout_token=example")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");RequestBody body = RequestBody.create(mediaType, "logout_token=example");Request request = new Request.Builder() .url("http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout") .post(body) .addHeader("Content-Type", "application/x-www-form-urlencoded") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const encodedParams = new URLSearchParams();encodedParams.set('logout_token', 'example');
const options = { method: 'POST', url: 'http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, data: encodedParams,};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({logout_token: 'example'})};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/x-www-form-urlencoded")val body = RequestBody.create(mediaType, "logout_token=example")val request = Request.Builder() .url("http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout") .post(body) .addHeader("Content-Type", "application/x-www-form-urlencoded") .build()
val response = client.newCall(request).execute()use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout";
let payload = json!({"logout_token": "example"});
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/x-www-form-urlencoded".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .form(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logout \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data logout_token=examplewget --quiet \ --method POST \ --header 'Content-Type: application/x-www-form-urlencoded' \ --body-data logout_token=example \ --output-document \ - http://127.0.0.1:58259/api/v1/auth/oidc/backchannel-logoutProcess OIDC backchannel logout token and invalidate matching session state.
Request Body
Section titled “Request Body ” Media type application/x-www-form-urlencoded
object
logout_token
required
string
Example generated
logout_token=exampleResponses
Section titled “ Responses ”OK