Module: OAuth2

Defined in:
lib/oauth2.rb,
lib/oauth2/error.rb,
lib/oauth2/client.rb,
lib/oauth2/version.rb,
lib/oauth2/response.rb,
lib/oauth2/access_token.rb,
lib/oauth2/authenticator.rb,
lib/oauth2/strategy/base.rb,
lib/oauth2/strategy/implicit.rb,
lib/oauth2/strategy/password.rb,
lib/oauth2/strategy/assertion.rb,
lib/oauth2/strategy/auth_code.rb,
lib/oauth2/filtered_attributes.rb,
lib/oauth2/strategy/client_credentials.rb

Overview

:nocov:

Defined Under Namespace

Modules: FilteredAttributes, Strategy, Version Classes: AccessToken, Authenticator, Client, Error, Response

Constant Summary collapse

OAUTH_DEBUG =

When true, enables verbose HTTP logging via Faraday’s logger middleware. Controlled by the OAUTH_DEBUG environment variable. Any case-insensitive value equal to “true” will enable debugging.

Returns:

  • (Boolean)
ENV.fetch("OAUTH_DEBUG", "false").casecmp("true").zero?
DEFAULT_CONFIG =

Default configuration values for the oauth2 library.

Examples:

Toggle warnings

OAuth2.configure do |config|
  config[:silence_extra_tokens_warning] = false
  config[:silence_no_tokens_warning] = false
end

Returns:

  • (SnakyHash::SymbolKeyed)

    A mutable Hash-like config with symbol keys

SnakyHash::SymbolKeyed.new(
  silence_extra_tokens_warning: true,
  silence_no_tokens_warning: true,
)
ConnectionError =
Class.new(Faraday::ConnectionFailed)
TimeoutError =
Class.new(Faraday::TimeoutError)

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configSnakyHash::SymbolKeyed (readonly)

Access the current configuration.

Prefer using configure to mutate configuration.

Returns:

  • (SnakyHash::SymbolKeyed)


63
64
65
# File 'lib/oauth2.rb', line 63

def config
  @config
end

Class Method Details

.configure {|config| ... } ⇒ void

This method returns an undefined value.

Configure global library behavior.

Yields the mutable configuration object so callers can update settings.

Yield Parameters:

  • config (SnakyHash::SymbolKeyed)

    the configuration object



72
73
74
# File 'lib/oauth2.rb', line 72

def configure
  yield @config
end