Sha256: 16a4d95d9e02381cd32c52a8587a89728786b0ede5f130e26f80f86320c5da9b

Contents?: true

Size: 599 Bytes

Versions: 2

Compression:

Stored size: 599 Bytes

Contents

# IMPROVE: redirect to clean the URL from the auth_token.
module Janus
  module Strategies
    class RemoteAuthenticatable < Base
      def valid?
        resource.include?(Janus::Models::RemoteAuthenticatable) && !remote_token.nil?
      end

      def authenticate!
        user = resource.find_for_remote_authentication(remote_token)
        
        if user
          success!(user)
        else
          pass
        end
      end

      def remote_token
        request.params[resource.remote_authentication_key]
      end

      def auth_method
        :set_user
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
janus-0.6.0 lib/janus/strategies/remote_authenticatable.rb
janus-0.5.0 lib/janus/strategies/remote_authenticatable.rb