title: Authenticate custom strategy without creating Devise user
body: <p>My setup: Rails 3.0.9, Ruby 1.9.2, Devise 1.3.4, Warden 1.0.4</p>
  
  <p>I'm trying to figure out if it possible to authenticate a custom strategy and not have to create a devise user in the process upon successful authentication. In my config.warden block, the authentication works fine but if I don't create a Devise user, I won't be authenticated. My ideal scenario requires me to either successfully authenticate against a 3rd party provider and sign into my app (using Devise without a corresponding Devise user record) or if I fail to authenticate, then try Devise standard login path.</p>
  
  <p>Here is the devise.rb code snippet I got working but I have to create a devise user for the authentication to work, this is something I wish to avoid</p>
  
  <pre><code>config.warden do |manager|
      manager.strategies.add(:custom_strategy) do
        def valid?
          params[:user] &amp;&amp; params[:user][:email] &amp;&amp; params[:user][:password]
        end
  
        def authenticate!
          ...perform authentication against 3rd party provider...
          if successful_authentication
            u = User.find_or_initialize_by_email(params[:user][:email])
            if u.new_record?
              u.app = 'blah'
              u.save
            end
            success!(u)
          end
        end
      end
  
  manager.default_strategies(:scope =&gt; :user).unshift :custom_strategy
    end
  </code></pre>