import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.revocation.process({
serviceId: "<id>",
revocationRequest: {
parameters: "VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token",
clientId: "26478243745571",
clientSecret: "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ",
},
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.revocation.process_request(service_id: '<id>', revocation_request: Models::Components::RevocationRequest.new(
parameters: 'VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token',
client_id: '26478243745571',
client_secret: 'gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ'
))
unless res.revocation_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Revocation.Process(ctx, "<id>", components.RevocationRequest{
Parameters: "VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token",
ClientID: authlete.Pointer("26478243745571"),
ClientSecret: authlete.Pointer("gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ"),
})
if err != nil {
log.Fatal(err)
}
if res.RevocationResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/auth/revocation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parameters": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"clientCertificate": "<string>",
"clientCertificatePath": [
"<string>"
],
"oauthClientAttestation": "<string>",
"oauthClientAttestationPop": "<string>"
}
'{
"resultCode": "A113001",
"resultMessage": "[A113001] The token has been revoked successfully.",
"action": "OK"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Process Revocation Request
This API revokes access tokens and refresh tokens.
import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.revocation.process({
serviceId: "<id>",
revocationRequest: {
parameters: "VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token",
clientId: "26478243745571",
clientSecret: "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ",
},
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.revocation.process_request(service_id: '<id>', revocation_request: Models::Components::RevocationRequest.new(
parameters: 'VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token',
client_id: '26478243745571',
client_secret: 'gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ'
))
unless res.revocation_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"github.com/authlete/authlete-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Revocation.Process(ctx, "<id>", components.RevocationRequest{
Parameters: "VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token",
ClientID: authlete.Pointer("26478243745571"),
ClientSecret: authlete.Pointer("gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ"),
})
if err != nil {
log.Fatal(err)
}
if res.RevocationResponse != nil {
// handle response
}
}curl --request POST \
--url https://us.authlete.com/api/{serviceId}/auth/revocation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parameters": "<string>",
"clientId": "<string>",
"clientSecret": "<string>",
"clientCertificate": "<string>",
"clientCertificatePath": [
"<string>"
],
"oauthClientAttestation": "<string>",
"oauthClientAttestationPop": "<string>"
}
'{
"resultCode": "A113001",
"resultMessage": "[A113001] The token has been revoked successfully.",
"action": "OK"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Authorizations
Authenticate every request with a Service Access Token or Organization Token.
Set the token value in the Authorization: Bearer <token> header.
Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.
Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.
Both token types are issued by the Authlete console or provisioning APIs.
Path Parameters
A service ID.
Body
OAuth 2.0 token revocation request parameters which are the request parameters that the OAuth 2.0 token revocation endpoint (RFC 7009) of the authorization server implementation received from the client application.
The value of parameters is the entire entity body (which is formatted in application/x-www-form-urlencoded) of the request
from the client application.
The client ID extracted from Authorization header of the revocation request from the client application.
If the revocation endpoint of the authorization server implementation supports Basic Authentication
as a means of client authentication, and the request from the client application contains its client ID in
Authorization header, the value should be extracted and set to this parameter.
The client secret extracted from Authorization header of the revocation request from the client application.
If the revocation endpoint of the authorization server implementation supports basic authentication as a means of
client authentication, and the request from the client application contained its client secret in Authorization header,
the value should be extracted and set to this parameter.
The client certificate used in the TLS connection between the client application and the revocation endpoint.
The certificate path presented by the client during client authentication.
The value of the OAuth-Client-Attestation HTTP header, which is defined in the specification
of OAuth 2.0 Attestation-Based Client Authentication.
The value of the OAuth-Client-Attestation-PoP HTTP header, which is defined in the specification
of OAuth 2.0 Attestation-Based Client Authentication.
Response
Token revoked successfully
The code which represents the result of the API call.
A short message which explains the result of the API call.
The next action that the authorization server implementation should take.
INTERNAL_SERVER_ERROR, INVALID_CLIENT, BAD_REQUEST, OK The content that the authorization server implementation is to return to the client application.
Its format varies depending on the value of action parameter.