Class: OmniAuth::Strategies::WindowsLive

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/windows_live.rb,
lib/omniauth/strategies/windows_live/windowslivelogin.rb

Defined Under Namespace

Classes: WindowsLiveLogin

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, app_id = nil, app_secret = nil, options = {}) ⇒ WindowsLive

Initialize the strategy by providing

Parameters:

  • app_id (String) (defaults to: nil)

    The application ID from your registered app with Microsoft.

  • app_secret (String) (defaults to: nil)

    The secret from your registered app with Microsoft.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :locale (String)

    A localization string for the login, should be in the form en-us or similar.

  • :state (String)

    Some state information that is serialized into the query string upon callback.

  • :ssl (Boolean)

    Whether or not to use SSL for login. Defaults to true.

  • :force_nonprovisioned (Boolean)

    When true, forces a non-provisioned (i.e. no app id or secret) mode.



19
20
21
22
23
24
25
26
# File 'lib/omniauth/strategies/windows_live.rb', line 19

def initialize(app, app_id = nil, app_secret = nil, options = {})
  self.app_id = app_id
  self.app_secret = app_secret
  super(app, :windows_live, app_id, app_secret, options)
  options[:ssl] ||= true
  options[:locale] ||= 'en-us'
  options[:force_nonprovisioned] = true unless app_id
end

Instance Attribute Details

#app_idObject

Returns the value of attribute app_id.



9
10
11
# File 'lib/omniauth/strategies/windows_live.rb', line 9

def app_id
  @app_id
end

#app_secretObject

Returns the value of attribute app_secret.



9
10
11
# File 'lib/omniauth/strategies/windows_live.rb', line 9

def app_secret
  @app_secret
end