Class: OmniAuth::Strategies::Yubikey

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, api_id = nil, api_key = nil, options = {}, &block) ⇒ Yubikey

Returns a new instance of Yubikey.



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

def initialize(app, api_id = nil, api_key = nil, options = {}, &block)
  self.api_id = api_id
  self.api_key = api_key

  super(app, :yubikey, options, &block)
end

Instance Attribute Details

#api_idObject

Returns the value of attribute api_id.



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

def api_id
  @api_id
end

#api_keyObject

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#otp_idObject (readonly)

Returns the value of attribute otp_id.



11
12
13
# File 'lib/omniauth/strategies/yubikey.rb', line 11

def otp_id
  @otp_id
end

Instance Method Details

#request_phaseObject



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

def request_phase
  if env["REQUEST_METHOD"] == "GET"
    get_credentials
  else
    perform
  end
end