Module: OmniAuth::Strategies::Oidc::Verify

Included in:
OmniAuth::Strategies::Oidc
Defined in:
lib/omniauth/strategies/oidc/verify.rb

Overview

Token verification phase

Instance Method Summary collapse

Instance Method Details

#pkce_authorize_params(verifier) ⇒ Object



13
14
15
16
17
18
# File 'lib/omniauth/strategies/oidc/verify.rb', line 13

def pkce_authorize_params(verifier)
  {
    code_challenge: options.pkce_options[:code_challenge].call(verifier),
    code_challenge_method: options.pkce_options[:code_challenge_method]
  }
end

#public_keyObject

Looks for key defined in omniauth initializer, if none is defined falls back to using jwks_uri returned by OIDC config_endpoint



22
23
24
25
26
27
28
# File 'lib/omniauth/strategies/oidc/verify.rb', line 22

def public_key
  @public_key ||= if configured_public_key
                    configured_public_key
                  elsif config.jwks_uri
                    fetch_key
                  end
end

#public_key_with_refreshObject

Force refresh JWKS cache and retry verification



31
32
33
34
35
36
37
# File 'lib/omniauth/strategies/oidc/verify.rb', line 31

def public_key_with_refresh
  OmniauthOidc::Logging.info("Force refreshing JWKS cache")
  OmniauthOidc::JwksCache.invalidate(config.jwks_uri)
  @public_key = nil
  @fetch_key = nil
  public_key
end

#secretObject

rubocop:disable Metrics/ModuleLength



8
9
10
# File 'lib/omniauth/strategies/oidc/verify.rb', line 8

def secret
  base64_decoded_jwt_secret || client_options.secret
end