Class: Janus::Strategies::RemoteAuthenticatable
- Inherits:
-
Base
- Object
- Base
- Janus::Strategies::RemoteAuthenticatable
show all
- Defined in:
- lib/janus/strategies/remote_authenticatable.rb
Instance Attribute Summary
Attributes inherited from Base
#cookies, #manager, #request, #scope, #user
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #pass, #resource, #success!, #success?
Instance Method Details
#auth_method ⇒ Object
23
24
25
|
# File 'lib/janus/strategies/remote_authenticatable.rb', line 23
def auth_method
:set_user
end
|
#authenticate! ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/janus/strategies/remote_authenticatable.rb', line 9
def authenticate!
user = resource.find_for_remote_authentication(remote_token)
if user
success!(user)
else
pass
end
end
|
#remote_token ⇒ Object
19
20
21
|
# File 'lib/janus/strategies/remote_authenticatable.rb', line 19
def remote_token
request.params[resource.remote_authentication_key]
end
|
#valid? ⇒ Boolean
5
6
7
|
# File 'lib/janus/strategies/remote_authenticatable.rb', line 5
def valid?
resource.include?(Janus::Models::RemoteAuthenticatable) && !remote_token.nil?
end
|