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.


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.


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