Class: Auth0::Prompts::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/auth0/prompts/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ void

Parameters:



9
10
11
# File 'lib/auth0/prompts/client.rb', line 9

def initialize(client:)
  @client = client
end

Instance Method Details

#custom_textAuth0::CustomText::Client

Returns:

  • (Auth0::CustomText::Client)


94
95
96
# File 'lib/auth0/prompts/client.rb', line 94

def custom_text
  @custom_text ||= Auth0::Prompts::CustomText::Client.new(client: @client)
end

#get_settings(request_options: {}, **params) ⇒ Auth0::Types::GetSettingsResponseContent

Retrieve details of the Universal Login configuration of your tenant. This includes the <a href=“auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first”>Identifier First Authentication</a> and <a href=“auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa”>WebAuthn with Device Biometrics for MFA</a> features.

Parameters:

  • request_options (Hash) (defaults to: {})
  • params (Hash)

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/auth0/prompts/client.rb', line 28

def get_settings(request_options: {}, **params)
  Auth0::Internal::Types::Utils.normalize_keys(params)
  request = Auth0::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "GET",
    path: "prompts",
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Auth0::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Auth0::Types::GetSettingsResponseContent.load(response.body)
  else
    error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end

#partialsAuth0::Partials::Client

Returns:

  • (Auth0::Partials::Client)


99
100
101
# File 'lib/auth0/prompts/client.rb', line 99

def partials
  @partials ||= Auth0::Prompts::Partials::Client.new(client: @client)
end

#renderingAuth0::Rendering::Client

Returns:

  • (Auth0::Rendering::Client)


89
90
91
# File 'lib/auth0/prompts/client.rb', line 89

def rendering
  @rendering ||= Auth0::Prompts::Rendering::Client.new(client: @client)
end

#update_settings(request_options: {}, **params) ⇒ Auth0::Types::UpdateSettingsResponseContent

Update the Universal Login configuration of your tenant. This includes the <a href=“auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first”>Identifier First Authentication</a> and <a href=“auth0.com/docs/secure/multi-factor-authentication/fido-authentication-with-webauthn/configure-webauthn-device-biometrics-for-mfa”>WebAuthn with Device Biometrics for MFA</a> features.

Parameters:

Options Hash (request_options:):

  • :base_url (String)
  • :additional_headers (Hash{String => Object})
  • :additional_query_parameters (Hash{String => Object})
  • :additional_body_parameters (Hash{String => Object})
  • :timeout_in_seconds (Integer)

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/auth0/prompts/client.rb', line 65

def update_settings(request_options: {}, **params)
  params = Auth0::Internal::Types::Utils.normalize_keys(params)
  request = Auth0::Internal::JSON::Request.new(
    base_url: request_options[:base_url],
    method: "PATCH",
    path: "prompts",
    body: Auth0::Prompts::Types::UpdateSettingsRequestContent.new(params).to_h,
    request_options: request_options
  )
  begin
    response = @client.send(request)
  rescue Net::HTTPRequestTimeout
    raise Auth0::Errors::TimeoutError
  end
  code = response.code.to_i
  if code.between?(200, 299)
    Auth0::Types::UpdateSettingsResponseContent.load(response.body)
  else
    error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
    raise error_class.new(response.body, code: code)
  end
end