Class: OmniAuth::Strategies::MicrosoftV2Auth

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

Constant Summary collapse

DEFAULT_SCOPE =
'openid email profile https://graph.microsoft.com/User.Read'

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/omniauth/strategies/microsoft_v2_auth.rb', line 37

def authorize_params
  super.tap do |params|
    %w[display score auth_type].each do |v|
      if request.params[v]
        params[v.to_sym] = request.params[v]
      end
    end

    params[:scope] ||= DEFAULT_SCOPE
  end
end

#callback_urlObject



49
50
51
# File 'lib/omniauth/strategies/microsoft_v2_auth.rb', line 49

def callback_url
  options[:redirect_uri] || (full_host + script_name + callback_path)
end

#raw_infoObject



33
34
35
# File 'lib/omniauth/strategies/microsoft_v2_auth.rb', line 33

def raw_info
  @raw_info ||= access_token.get('https://graph.microsoft.com/v1.0/me').parsed
end