Module: AuthProviders

Defined in:
app/services/auth_providers.rb,
app/services/auth_providers/okta_jwt_provider.rb,
app/services/auth_providers/bearer_token_provider.rb

Overview

Provides interface for authentication providers used for bearer token validation.

Defined Under Namespace

Classes: BearerTokenProvider, OktaJwtProvider

Class Method Summary collapse

Class Method Details

.build_bearer_token_providerAuthProviders::BearerTokenProvider

Loads the authentication provider config and returns an instance of the appropriate provider. Currently supports Okta JWT provider.

Returns:

Raises:

  • (RuntimeError)

    if the provider is unknown



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/services/auth_providers.rb', line 12

def self.build_bearer_token_provider
  config = Rails.application.config.auth.with_indifferent_access
  case config[:provider]
  when 'okta'
    AuthProviders::OktaJwtProvider.new(
      issuer: config[:issuer],
      audience: config[:audience],
      jwks_uri: config[:jwks_uri],
      client_id: config[:client_id]
    )
  else
    raise "Unknown auth provider: #{config[:provider]}"
  end
end