Maintenance

Revoke JWT

This endpoint allows you to revoke JSON Web Tokens created by your service. Revoked tokens are invalided before they would normally expire. On top of preventing any future authentications with revoked JWTs, any active authenticated session is also destroyed immediately.

It's only possible to revoke JWTs with an ID that needs to be specified in their jti claim. Note that revoking a particular JWTs will revoke all JWTs with the same ID as well.

post/api/revoke

Request

  • Base URL: http://localhost:5000
  • URL: http://localhost:5000/api/revoke
  • Auth: one of:
    • API key in header Authorization
    • HTTP bearer

Request body

jwtsJWT[]

Example request

{
  "jwts": [
    "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJtaXNzaW9ucyI6WyJyZWFkLWRvY3VtZW50Iiwid3JpdGUiLCJkb3dubG9hZCJdLCJkb2N1bWVudF9pZCI6IjdLUFNKTkZCVkpFNzlXR0IxM05DRzdTMlgzIiwibGF5ZXIiOiJwUUNHREVpVVFFWTdleEJfcW5zeC1BIiwiaWF0IjoxNjYwOTA4ODk0LCJleHAiOjE2NjExNjgwOTQsImp0aSI6IjU5OTAwZDVmLTIyMDgtNDNjMy1iYzk3LWMxMjgzNDI3NmM4YyJ9.BtBbivWY2cC3R_8tm1j_GxtcQFIvmGkTSsz78EXiJEsTUCkRcfZWN2lOsI0Dn2-M6sG21QSbToEhVMvL5r_4sg"
  ]
}

Response

Token revocation finished.

detailsstring

A text summary of the status of the request

request_idstring
result'partial_failure' | 'success' | 'failure'

If all the items in the batch request were successful, then the status will be a success. A partial_failure will occur if only a few of the items in the batch request succeeded. Failure is when none of the items in the batch succeed.

status200 | 400 | 500

HTTP status code for the request. The status code is 200 if the request was processed. This does not have anything to do with the result - the status code will be 200 even if part of the request failed. In the case of total failures such as malformed JSON, or document not found, this status will be other than 200.

dataJWT[]

List of successfully revoked JWTs.

Example response

{
  "details": "Operation was partially successful",
  "failingPaths": [
    {
      "path": "$.property[0]",
      "details": "Missing required property"
    }
  ],
  "data": [
    "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJwZXJtaXNzaW9ucyI6WyJyZWFkLWRvY3VtZW50Iiwid3JpdGUiLCJkb3dubG9hZCJdLCJkb2N1bWVudF9pZCI6IjdLUFNKTkZCVkpFNzlXR0IxM05DRzdTMlgzIiwibGF5ZXIiOiJwUUNHREVpVVFFWTdleEJfcW5zeC1BIiwiaWF0IjoxNjYwOTA4ODk0LCJleHAiOjE2NjExNjgwOTQsImp0aSI6IjU5OTAwZDVmLTIyMDgtNDNjMy1iYzk3LWMxMjgzNDI3NmM4YyJ9.BtBbivWY2cC3R_8tm1j_GxtcQFIvmGkTSsz78EXiJEsTUCkRcfZWN2lOsI0Dn2-M6sG21QSbToEhVMvL5r_4sg"
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.