Module: Auth0::Api::V2::Blacklists

Included in:
Auth0::Api::V2
Defined in:
lib/auth0/api/v2/blacklists.rb

Overview

Methods to use the blacklist endpoints

Instance Method Summary collapse

Instance Method Details

#add_token_to_blacklist(jti, aud = nil) ⇒ json

Adds the token identified by the jti to a blacklist for the tenant.

Parameters:

  • jti (string)

    The jti of the JWT to blacklist

  • aud (string) (defaults to: nil)

    The JWT’s aud claim. The client_id of the client for which it was issued

Returns:

  • (json)

    Returns the blacklisted token

Raises:

See Also:



27
28
29
30
31
32
33
34
# File 'lib/auth0/api/v2/blacklists.rb', line 27

def add_token_to_blacklist(jti, aud = nil)
  raise Auth0::MissingParameter, 'Must specify a valid JTI' if jti.to_s.empty?
  request_params = {
    jti: jti,
    aud: aud
  }
  post(blacklists_path, request_params)
end

#blacklisted_tokens(aud = nil) ⇒ json

Retrieves the jti and aud of all tokens in the blacklist.

Parameters:

  • aud (string) (defaults to: nil)

    The JWT’s aud claim. The client_id of the client for which it was issued

Returns:

  • (json)

    Returns the blacklisted tokens

See Also:



14
15
16
17
18
19
# File 'lib/auth0/api/v2/blacklists.rb', line 14

def blacklisted_tokens(aud = nil)
  request_params = {
    aud: aud
  }
  get(blacklists_path, request_params)
end