Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a bit of doc to Developer strategy.

  • Loading branch information...
commit 78301c00bb5140aa43a7727da984becd355f5a80 1 parent 250963a
Michael Bleigh authored
View
7 README.md
@@ -18,7 +18,12 @@ one or more strategies. These strategies are generally released
individually as RubyGems, and you can see a [community maintained list](https://github.com/intridea/omniauth/wiki/List-of-Strategies)
on the wiki for this project.
-## Adding OmniAuth to Your Application
+One strategy, called `Developer`, is included with OmniAuth and provides
+a completely unsecure, non-production-usable strategy that directly
+prompts a user for authentication information and then passes it
+straight through.
+
+## Getting Started
Each OmniAuth strategy is a Rack Middleware. That means that you can use
it the same way that you use any other Rack middleware. For example, to
View
23 lib/omniauth/strategies/developer.rb
@@ -2,6 +2,29 @@
module OmniAuth
module Strategies
+ # The Developer strategy is a very simple strategy that can be used as a
+ # placeholder in your application until a different authentication strategy
+ # is swapped in. It has zero security and should *never* be used in a
+ # production setting.
+ #
+ # ## Usage
+ #
+ # To use the Developer strategy, all you need to do is put it in like any
+ # other strategy:
+ #
+ # @example Basic Usage
+ #
+ # use OmniAuth::Builder do
+ # provider :developer
+ # end
+ #
+ # This will create a strategy that, when the user visits `/auth/developer`
+ # they will be presented a form that prompts for (by default) their name
+ # and email address. The auth hash will be populated with these fields and
+ # the `uid` will simply be set to the provided email.
+ #
+ # @option options [Array] :fields An array of fields you would like to collect.
+ # @option options [Symbol] :uid_field The field you'd like to use for the uid.
class Developer
include OmniAuth::Strategy
View
2  spec/omniauth/strategies/developer_spec.rb
@@ -4,7 +4,7 @@
let(:app){ Rack::Builder.new do |b|
b.use Rack::Session::Cookie
b.use OmniAuth::Strategies::Developer
- b.run lambda{|env| [200, {:auth_hash => env['omniauth.auth']}, ['Not Found']]}
+ b.run lambda{|env| [200, {}, ['Not Found']]}
end.to_app }
context 'request phase' do
Please sign in to comment.
Something went wrong with that request. Please try again.