title: Devise ignoring custom strategy
body: <p>This is just plain weird. </p>
  
  <p>I've got Rails 3 RC running with <a href="http://github.com/plataformatec/devise" rel="noreferrer">Devise</a> installed. I've defined a custom strategy to try and use Kerberos for authentication. </p>
  
  <pre><code>module Devise
    module Strategies
      class Kerb &lt; Devise::Strategies::Base
        def valid?
          params[:username] || params[:password]
        end
  
        def authenticate!
          # cheap debugging
          puts "PARAMS: #{params}"
  
          if check_kerb_auth(params[:username], params[:password])
            # create user account if none exists
            u = User.find(:first, :conditions =&gt; { :username =&gt; params[:username] }) || User.create({ :username =&gt; login })
            success!(u)
          else
            fail!("Could not log in")
          end
        end
  
        def check_kerb_auth(username, password)
          require 'krb5_auth'
          include Krb5Auth
  
          return false if username.blank? or password.blank?
  
          begin
              kerberos = Krb5.new
              return kerberos.get_init_creds_password(username, password)
          rescue Krb5Auth::Krb5::Exception
              return false
          end
        end
      end
    end
  end
  </code></pre>
  
  <p>I have the Devise <a href="http://github.com/hassox/warden" rel="noreferrer">Warden</a> configuration setup as follows:</p>
  
  <pre><code>config.warden do |manager|
    manager.strategies.add(:kerb, Devise::Strategies::Kerb)
    manager.default_strategies :kerb
  end
  </code></pre>
  
  <p>I get no errors in my log. Everything seems to work ok. If I add "cheap debugging" aka a bunch of puts statements, it seems to reflect that the :kerb strategy is the default. Here is a sample set of logs from a login attempt:</p>
  
  <pre><code>=&gt; Booting WEBrick
  =&gt; Rails 3.0.0.rc application starting in development on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  [2010-08-17 10:50:35] INFO  WEBrick 1.3.1
  [2010-08-17 10:50:35] INFO  ruby 1.8.7 (2010-01-10) [x86_64-linux]
  [2010-08-17 10:50:40] INFO  WEBrick::HTTPServer#start: pid=12717 port=3000
  
  
  Started POST "/users/login" for 127.0.0.1 at Tue Aug 17 10:50:43 -0400 2010
    Processing by Devise::SessionsController#create as HTML
    Parameters: {"commit"=&gt;"Login", "authenticity_token"=&gt;"afZF6ho96p47dc9LQFwwNN5PqnRpl7x+1J7V3MiKgTE=", "_snowman"=&gt;"\342\230\203", "user"=&gt;{"remember_me"=&gt;"1", "username"=&gt;"hernan43", "password"=&gt;"[FILTERED]"}}
  Completed   in 0ms
    Processing by Devise::SessionsController#new as HTML
    Parameters: {"commit"=&gt;"Login", "authenticity_token"=&gt;"afZF6ho96p47dc9LQFwwNN5PqnRpl7x+1J7V3MiKgTE=", "_snowman"=&gt;"\342\230\203", "user"=&gt;{"remember_me"=&gt;"1", "username"=&gt;"hernan43", "password"=&gt;"[FILTERED]"}}
  Rendered devise/shared/_links.erb (1.2ms)
  Rendered devise/sessions/new.html.erb within layouts/application (8.2ms)
  Completed 200 OK in 124ms (Views: 11.7ms | ActiveRecord: 1.3ms)
  </code></pre>
  
  <p>The kerberos code works in other things on the same machine. I was sort of expecting it to show a bunch of errors if there was a problem but I am getting nothing. Is there a good way to debug Devise/Warden? </p>