- process - 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();The standalone function version of this method:
import { AuthleteCore } from "@authlete/typescript-sdk/core.js";
import { revocationProcess } from "@authlete/typescript-sdk/funcs/revocationProcess.js";
// Use `AuthleteCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const authlete = new AuthleteCore({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const res = await revocationProcess(authlete, {
serviceId: "<id>",
revocationRequest: {
parameters: "VFGsNK-5sXiqterdaR7b5QbRX9VTwVCQB87jbr2_xAI&token_type_hint=access_token",
clientId: "26478243745571",
clientSecret: "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("revocationProcess failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AuthRevocationApiRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.RevocationResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ResultError | 400, 401, 403 | application/json |
| errors.ResultError | 500 | application/json |
| errors.AuthleteDefaultError | 4XX, 5XX | */* |