Mozilla Persona, formerly known as BrowserID, is a great implementation of verified email that lets you quickly and easily login to websites. This is an OmniAuth strategy that allows you to use Persona in your application!
gem install omniauth-browserid
To use the built-in form in order to authenticate with Persona, you simply need to add the strategy to your application:
use ::Builder do provider :browser_id end
Now all you need to do is redirect your users to
/auth/browser_id and you're all set!
What this does is sets up a form with a "Login with Persona" button. When the button of the form is clicked, it is intercepted by jQuery and the Persona flow is started. Persona returns an
assertion that is then used to verify an email. In this example, the form points to
/auth/browser_id/callback which will automatically perform verification as well as return a standard OmniAuth hash.
These are the options you can specify that are relevant to Omniauth BrowserID:
:verify_url- The verifier URL (defaults to
:name- The URL at which the strategy will be available (defaults to
:audience_url- The host of your site. Defaults to the
full_hostof OmniAuth (either automatically determined or determined by the
Copyright (c) 2011 Michael Bleigh and Intridea, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.