Skip to main content

revoke

Function revoke 

Source
pub async fn revoke(
    __arg0: State<ApiState>,
    __arg1: Json<RevokeRequest>,
) -> ApiResponse<Value>
Expand description

POST /api/v1/oauth/revoke โ€” revoke an access or refresh token.

Stores a revocation marker in KV (oauth2_revoked_token:{token}) and, for JWT tokens, also stores a JTI-based marker (revoked_token:{jti}) so that all authenticated endpoints reject the token immediately.

ยงExample

โ“˜
let resp = revoke(State(state), Json(RevokeRequest {
    token: "access_token_value".into(),
    token_type_hint: Some("access_token".into()),
})).await;
assert!(resp.success);