Signoff (POST)
POST {{authPath}}/{{envID}}/as/signoff
Use POST /{{envID}}/as/signoff to initiate user logout with optional parameters specified in the request body. The Cookie request header specifies the current session token.
The request body can include an optional parameter id_token_hint specifying the ID token passed to the logout endpoint as a hint about the user’s current authenticated session. The application identified by the ID token must exist, and must not be disabled. The user identified by the ID token must be the user identified by the current session.
The id_token_hint value is validated as follows:
-
It must be signed by an application identified in the
audclaim. -
The
issclaim must match the authorization server URL used for the/signoffrequest:-
If a custom domain is used (the URL is
https://<custom domain="">/as/signoff), theissclaim must behttps://<custom domain="">/as.</custom></custom>. -
The geographic domain specified in the URL (
https://auth.pingone.[tld]/{envId}/as/signoff), must behttps://auth.pingone.[tld]/{envID}/asin theissclaim.
-
|
The |
The endpoint returns a 302 Found message with the following confirmation URL in the Location header:
https://apps.pingone.com/{{envID}}/signon/#signedOff
For more information about PingOne SSO sessions and sign off, refer to Sessions.
Request Model
Refer to OpenID Connect/OAuth 2 for complete property descriptions.
| Property | Type | Required |
|---|---|---|
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
For the user to be redirected successfully, post_logout_redirect_uri and state must have a combined value of less than 8192 characters.
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff --request POST '{{authPath}}/{{envID}}/as/signoff' \
--header 'Cookie: {{sessionToken}}' \
--header 'Content-Type: application/x-www-form-urlencoded'
var options = new RestClientOptions("{{authPath}}/{{envID}}/as/signoff")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Cookie", "{{sessionToken}}");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{authPath}}/{{envID}}/as/signoff"
method := "POST"
payload := strings.NewReader("")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Cookie", "{{sessionToken}}")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /{{envID}}/as/signoff HTTP/1.1
Host: {{authPath}}
Cookie: {{sessionToken}}
Content-Type: application/x-www-form-urlencoded
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("{{authPath}}/{{envID}}/as/signoff")
.method("POST", body)
.addHeader("Cookie", "{{sessionToken}}")
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{authPath}}/{{envID}}/as/signoff",
"method": "POST",
"timeout": 0,
"headers": {
"Cookie": "{{sessionToken}}",
"Content-Type": "application/x-www-form-urlencoded"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'POST',
'url': '{{authPath}}/{{envID}}/as/signoff',
'headers': {
'Cookie': '{{sessionToken}}',
'Content-Type': 'application/x-www-form-urlencoded'
},
form: {
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "{{authPath}}/{{envID}}/as/signoff"
payload = {}
headers = {
'Cookie': '{{sessionToken}}',
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{authPath}}/{{envID}}/as/signoff');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Cookie' => '{{sessionToken}}',
'Content-Type' => 'application/x-www-form-urlencoded'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "net/http"
url = URI("{{authPath}}/{{envID}}/as/signoff")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Cookie"] = "{{sessionToken}}"
request["Content-Type"] = "application/x-www-form-urlencoded"
response = http.request(request)
puts response.read_body
let parameters = ""
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{authPath}}/{{envID}}/as/signoff")!,timeoutInterval: Double.infinity)
request.addValue("{{sessionToken}}", forHTTPHeaderField: "Cookie")
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()