Class: Janus::Strategies::RemoteAuthenticatable

Inherits:
Base
  • Object
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?

Constructor Details

This class inherits a constructor from Janus::Strategies::Base

Instance Method Details

#auth_methodObject



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_tokenObject



19
20
21
# File 'lib/janus/strategies/remote_authenticatable.rb', line 19

def remote_token
  request.params[resource.remote_authentication_key]
end

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/janus/strategies/remote_authenticatable.rb', line 5

def valid?
  resource.include?(Janus::Models::RemoteAuthenticatable) && !remote_token.nil?
end