Class: OmniAuth::Strategies::Whichsignupapi
Instance Method Summary
collapse
#delegate_to, #extra, #info, #uid
Instance Method Details
#authenticate(login, password, always_get_details = false) ⇒ Object
35
36
37
38
39
|
# File 'lib/omniauth/strategies/whichsignupapi.rb', line 35
def authenticate(login, password, always_get_details = false)
result = OmniAuth::Whichsignupapi::ApiMethods.login(options['api_url'], options['api_secret'], options['token_secret'], login, password || '', always_get_details)
fail!(:invalid_credentials) unless result[:authenticated] || always_get_details
OmniAuth::Whichsignupapi::AuthHashDelegate.new(options['name'], result)
end
|
#callback_phase ⇒ Object
25
26
27
28
29
|
# File 'lib/omniauth/strategies/whichsignupapi.rb', line 25
def callback_phase
results = authenticate(request['login'], request['password'])
delegate_to(results)
super
end
|
#handles(login) ⇒ Object
31
32
33
|
# File 'lib/omniauth/strategies/whichsignupapi.rb', line 31
def handles(login)
OmniAuth::Whichsignupapi::ApiMethods.handles(options['api_url'], options['api_secret'], options['token_secret'], login)
end
|
#request_phase ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/omniauth/strategies/whichsignupapi.rb', line 17
def request_phase
form = OmniAuth::Form.new(:title => "Which? Login", :url => callback_path)
form.text_field "Email or Which? username", 'login'
form.text_field "Password", 'password'
form.button "Sign In"
form.to_response
end
|