Class: OmniAuth::Strategies::DoximityOauth2

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/doximity_oauth2.rb

Overview

Doximity OmniAuth strategy.

Constant Summary collapse

DEFAULT_SCOPE =
"openid profile:read:basic"

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject

rubocop:disable Metrics/AbcSize



78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/omniauth/strategies/doximity_oauth2.rb', line 78

def authorize_params # rubocop:disable Metrics/AbcSize
  super.tap do |params|
    options[:authorize_options].each do |v|
      params[v.to_sym] = request.params[v.to_s] if request.params[v.to_s]
    end

    params[:scope] = get_scope(params)

    # Ensure state is persisted
    session['omniauth.state'] = params[:state] if params[:state]
  end
end

#raw_credential_infoObject



74
75
76
# File 'lib/omniauth/strategies/doximity_oauth2.rb', line 74

def raw_credential_info
  @raw_credential_info ||= access_token.to_hash.with_indifferent_access
end

#raw_subject_infoObject



70
71
72
# File 'lib/omniauth/strategies/doximity_oauth2.rb', line 70

def raw_subject_info
  @raw_subject_info ||= parse_id_token(access_token["id_token"] || access_token.get("/oauth/userinfo").body) || {}
end