Skip to content

Cleaning Expired and Revoked OAuth2 Tokens

Eliza Margaretha edited this page Apr 16, 2024 · 5 revisions

** WARNING: This service is experimental and may change without any notice.

This service enables system admin to remove expired and revoked access and refresh OAuth2 tokens from the database. It requires admin authentication either by using the Authorization header or including an admin token in the request body. At server starts-up, Kustvakt automatically generates an adminToken file at the data folder, if it has not existed already.

Available in: full version

Method: POST

Service URL: root/admin/oauth2/token/clean

Parameters

Header Parameters

Name Required Description Value
Content-Type yes content type of the input data application/x-www-form-urlencoded
Authorization yes, if admin token is not included in the request HTTP authentication with scheme: Bearer OAuth2 access token

Request body URL-encoded form parameters

Name Required Description Type
token yes, if authorization header is not included The admin token automatically generated by Kustvakt server in the root folder String

Examples

Request with admin token

Run the command on the root folder containing the admin token file:

curl -v -H 'Content-Type: application/x-www-form-urlencoded' \
     -d @adminToken \
     http://localhost:8089/api/v1.0/admin/oauth2/token/clean

or describe an adminToken explicitly in the command:

curl -v -H 'Content-Type: application/x-www-form-urlencoded'  \
     -d 'token=Rn8zb30nkqVlHd_Wxt2DpE' \
     http://localhost:8089/api/v1.0/admin/oauth2/token/clean

Request with authorization header

curl -v -H 'Content-Type: application/x-www-form-urlencoded' \
     -H 'Authorization: Bearer f70p9lBCIufy_9LYEef2jQzJLlBMpc1egkv4dCBxcD3A' \
     -X POST \
     'http://localhost:8089/api/v1.0/admin/oauth2/token/clean'

Advanced Setting

Developer Setting

Search services

Metadata services

Authentication and Authorization services

Client services

Super client services

Plugin services

User services

User group services

Virtual corpus services

Virtual corpus access services

Administrative services

Description services

Clone this wiki locally