Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Create gh-pages branch via GitHub

  • Loading branch information...
commit d15ccd4c9c02fd9fcaa94b4d519703f0acf548d6 1 parent ef38aa0
@phlipper phlipper authored
Showing with 48 additions and 8 deletions.
  1. +47 −7 index.html
  2. +1 −1  params.json
View
54 index.html
@@ -87,6 +87,15 @@
<p>The <code>Thincloud::Authentication</code> module accepts a <code>configure</code> block with options to customize the engine behavior.</p>
+<h3>Layouts</h3>
+
+<p>Set the <code>layout</code> option to customize the layout used by all thincloud-authentication views:</p>
+
+<div class="highlight"><pre><span class="no">Thincloud</span><span class="o">::</span><span class="no">Authentication</span><span class="o">.</span><span class="n">configure</span> <span class="k">do</span> <span class="o">|</span><span class="n">config</span><span class="o">|</span>
+ <span class="n">config</span><span class="o">.</span><span class="n">layout</span> <span class="o">=</span> <span class="s2">"other"</span>
+<span class="k">end</span>
+</pre></div>
+
<h3>Mailers</h3>
<p>Set the <code>mailer_sender</code> option to customize the "From" address of the emails sent from the system:</p>
@@ -98,19 +107,39 @@
<h3>Additional provider strategies</h3>
-<p>Add a key to the <code>providers</code> hash with the name of the strategy, followed by additional options for <code>scopes</code> and <code>fields</code> as needed. Additionally, you will need to provide environment variables (prefixed with the provider name), with the <code>consumer_key</code> and <code>consumer_secret</code> values from your OAuth provider.</p>
+<ul>
+<li>Require the <code>omniauth-#{provider}</code> gem before the <code>thincloud-authentication</code> gem in the <code>Gemfile</code>:</li>
+</ul><div class="highlight"><pre><span class="n">gem</span> <span class="s2">"omniauth-linkedin"</span>
+<span class="n">gem</span> <span class="s2">"omniauth-stripe-connect"</span>
+<span class="n">gem</span> <span class="s2">"thincloud-authentication"</span>
+</pre></div>
+
+<ul>
+<li>Add a key to the <code>providers</code> hash with the name of the strategy, followed by additional options for <code>require</code>, <code>scopes</code> and <code>fields</code> as needed. Additionally, you will need to provide environment variables (prefixed with the provider name), with the <code>consumer_key</code> and <code>consumer_secret</code> values from your OAuth provider.</li>
+</ul><p>To enable the <a href="https://github.com/skorks/omniauth-linkedin">LinkedIn</a> and <a href="https://github.com/isaacsanders/omniauth-stripe-connect">Stripe Connect</a> providers:</p>
-<p>To enable the <a href="https://github.com/skorks/omniauth-linkedin">LinkedIn</a> provider:</p>
+<ul>
+<li>Provide values for following environment variables:
<ul>
-<li>Provide values for <code>ENV["LINKEDIN_CONSUMER_KEY"]</code> and <code>ENV["LINKEDIN_CONSUMER_SECRET"]</code>
+<li><code>ENV["LINKEDIN_CONSUMER_KEY"]</code></li>
+<li><code>ENV["LINKEDIN_CONSUMER_SECRET"]</code></li>
+<li><code>ENV["STRIPE_CONNECT_CONSUMER_KEY"]</code></li>
+<li><code>ENV["STRIPE_CONNECT_CONSUMER_SECRET"]</code></li>
+</ul>
</li>
<li>Add the file <code>config/initializers/thincloud_authentication.rb</code> with the following contents:</li>
</ul><div class="highlight"><pre><span class="no">Thincloud</span><span class="o">::</span><span class="no">Authentication</span><span class="o">.</span><span class="n">configure</span> <span class="k">do</span> <span class="o">|</span><span class="n">config</span><span class="o">|</span>
- <span class="n">config</span><span class="o">.</span><span class="n">providers</span><span class="o">[</span><span class="ss">:linkedin</span><span class="o">]</span> <span class="o">=</span> <span class="p">{</span>
- <span class="n">scopes</span><span class="p">:</span> <span class="s2">"r_emailaddress r_basicprofile"</span><span class="p">,</span>
- <span class="n">fields</span><span class="p">:</span> <span class="o">[</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"email-address"</span><span class="p">,</span> <span class="s2">"first-name"</span><span class="p">,</span> <span class="s2">"last-name"</span><span class="p">,</span> <span class="s2">"headline"</span><span class="p">,</span>
- <span class="s2">"industry"</span><span class="p">,</span> <span class="s2">"picture-url"</span><span class="p">,</span> <span class="s2">"location"</span><span class="p">,</span> <span class="s2">"public-profile-url"</span><span class="o">]</span>
+ <span class="n">config</span><span class="o">.</span><span class="n">providers</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="n">linkedin</span><span class="p">:</span> <span class="p">{</span>
+ <span class="n">scopes</span><span class="p">:</span> <span class="s2">"r_emailaddress r_basicprofile"</span><span class="p">,</span>
+ <span class="n">fields</span><span class="p">:</span> <span class="o">[</span><span class="s2">"id"</span><span class="p">,</span> <span class="s2">"email-address"</span><span class="p">,</span> <span class="s2">"first-name"</span><span class="p">,</span> <span class="s2">"last-name"</span><span class="p">,</span> <span class="s2">"headline"</span><span class="p">,</span>
+ <span class="s2">"industry"</span><span class="p">,</span> <span class="s2">"picture-url"</span><span class="p">,</span> <span class="s2">"location"</span><span class="p">,</span> <span class="s2">"public-profile-url"</span><span class="o">]</span>
+ <span class="p">},</span>
+ <span class="n">stripe_connect</span><span class="p">:</span> <span class="p">{</span>
+ <span class="nb">require</span><span class="p">:</span> <span class="s2">"omniauth-stripe-connect"</span><span class="p">,</span>
+ <span class="n">scopes</span><span class="p">:</span> <span class="s2">"read_write"</span>
+ <span class="p">}</span>
<span class="p">}</span>
<span class="k">end</span>
</pre></div>
@@ -133,6 +162,17 @@
<code>login_url</code> points to "/login"</li>
<li>
<code>logout_url</code> points to "/logout" - Make sure to use the <code>delete</code> method to logout.</li>
+</ul><h3>Redirection</h3>
+
+<p>You can customize the paths used to redirect users after login, logout and registration by overriding the corresponding methods in your ApplicationController, or specific controllers, as needed.</p>
+
+<ul>
+<li>
+<code>after_login_path</code> is used after the user logs in.</li>
+<li>
+<code>after_logout_path</code> is used after the user logs out.</li>
+<li>
+<code>after_registration_path</code> is used after the user registers.</li>
</ul><h2>TODO</h2>
<ul>
View
2  params.json
@@ -1 +1 @@
-{"name":"Thincloud Authentication","body":"# Thincloud::Authentication\r\n\r\n[![Build Status](https://secure.travis-ci.org/newleaders/thincloud-authentication.png)](http://travis-ci.org/newleaders/thincloud-authentication) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/newleaders/thincloud-authentication)\r\n\r\n## Description\r\n\r\nA Rails Engine to provide authentication for Thincloud applications.\r\n\r\n## Requirements\r\n\r\nThis gem requires Rails 3.2+ and has been tested on the following versions:\r\n\r\n* 3.2\r\n\r\nThis gem has been tested against the following Ruby versions:\r\n\r\n* MRI 1.9.2\r\n* MRI 1.9.3\r\n* JRuby 1.6+ (with `JRUBY_OPTS=--1.9`)\r\n* Rubinius 2.0.0dev (with `RBXOPT=-X19`)\r\n\r\nThis gem has been tested against the following database versions:\r\n\r\n* MySQL 5.0, 5.5\r\n* PostgreSQL 9.1, 9.2\r\n* SQLite 3\r\n\r\n\r\n## Installation\r\n\r\nAdd this line to your application's Gemfile:\r\n\r\n``` ruby\r\ngem \"thincloud-authentication\"\r\n```\r\n\r\n* Run `bundle`\r\n* Copy the migrations and prepare your databases:\r\n\r\n```\r\n$ rake thincloud_authentication:install:migrations db:migrate db:test:prepare\r\n```\r\n\r\n* Mount the engine in your `config/routes.rb` file:\r\n\r\n```ruby\r\nmount Thincloud::Authentication::Engine => \"/auth\", as: \"auth_engine\"\r\n```\r\n\r\nUsing the example above, you may now login or signup at [http://lvh.me:3000/auth](http://lvh.me:3000/auth).\r\n\r\n### Prerequisites\r\n\r\nThe following must be true for `thincloud-authentication` to operate properly:\r\n\r\n* A `root_url` must be defined in `config/routes.rb`\r\n* A `User` model must exist\r\n\r\n\r\n## Configuration\r\n\r\nThe `Thincloud::Authentication` module accepts a `configure` block with options to customize the engine behavior.\r\n\r\n\r\n### Mailers\r\n\r\nSet the `mailer_sender` option to customize the \"From\" address of the emails sent from the system:\r\n\r\n```ruby\r\nThincloud::Authentication.configure do |config|\r\n config.mailer_sender = \"app@example.com\"\r\nend\r\n```\r\n\r\n\r\n### Additional provider strategies\r\n\r\nAdd a key to the `providers` hash with the name of the strategy, followed by additional options for `scopes` and `fields` as needed. Additionally, you will need to provide environment variables (prefixed with the provider name), with the `consumer_key` and `consumer_secret` values from your OAuth provider.\r\n\r\nTo enable the [LinkedIn](https://github.com/skorks/omniauth-linkedin) provider:\r\n\r\n* Provide values for `ENV[\"LINKEDIN_CONSUMER_KEY\"]` and `ENV[\"LINKEDIN_CONSUMER_SECRET\"]`\r\n* Add the file `config/initializers/thincloud_authentication.rb` with the following contents:\r\n\r\n```ruby\r\nThincloud::Authentication.configure do |config|\r\n config.providers[:linkedin] = {\r\n scopes: \"r_emailaddress r_basicprofile\",\r\n fields: [\"id\", \"email-address\", \"first-name\", \"last-name\", \"headline\",\r\n \"industry\", \"picture-url\", \"location\", \"public-profile-url\"]\r\n }\r\nend\r\n```\r\n\r\n\r\n### Vanity Routes\r\n\r\nIf you want to customize the routes (remove the `/auth` prefix), you may add the following to your `config/routes.rb` file:\r\n\r\n```ruby\r\nget \"signup\", to: \"thincloud/authentication/registrations#new\", as: \"signup\"\r\nget \"login\", to: \"thincloud/authentication/sessions#new\", as: \"login\"\r\ndelete \"logout\", to: \"thincloud/authentication/sessions#destroy\", as: \"logout\"\r\n```\r\n\r\nUsing the example above, you will have the following routes locally:\r\n\r\n* `signup_url` points to \"/signup\"\r\n* `login_url` points to \"/login\"\r\n* `logout_url` points to \"/logout\" - Make sure to use the `delete` method to logout.\r\n\r\n\r\n## TODO\r\n\r\n* Add \"forgot password\" functionality\r\n* Add multiple, configurable strategy options\r\n* Add a configuration option to customize the mailers\r\n\r\n\r\n## Contributing\r\n\r\n1. [Fork it](https://github.com/newleaders/thincloud-authentication/fork_select)\r\n2. Create your feature branch (`git checkout -b my-new-feature`)\r\n3. Commit your changes (`git commit -am 'Added some feature'`)\r\n4. Push to the branch (`git push origin my-new-feature`)\r\n5. [Create a Pull Request](https://github.com/newleaders/thincloud-authentication/pull/new)\r\n\r\n\r\n## License\r\n\r\n* Freely distributable and licensed under the [MIT license](http://newleaders.mit-license.org/2012/license.html).\r\n* Copyright (c) 2012 New Leaders ([opensource@newleaders.com](opensource@newleaders.com))\r\n* [https://newleaders.com](https://newleaders.com)\r\n","tagline":"A Rails Engine to provide authentication for Thincloud applications.","google":"UA-1755363-18","note":"Don't delete this file! It's used internally to help with page regeneration."}
+{"note":"Don't delete this file! It's used internally to help with page regeneration.","name":"Thincloud Authentication","tagline":"A Rails Engine to provide authentication for Thincloud applications.","google":"UA-1755363-18","body":"# Thincloud::Authentication\r\n\r\n[![Build Status](https://secure.travis-ci.org/newleaders/thincloud-authentication.png)](http://travis-ci.org/newleaders/thincloud-authentication) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/newleaders/thincloud-authentication)\r\n\r\n## Description\r\n\r\nA Rails Engine to provide authentication for Thincloud applications.\r\n\r\n## Requirements\r\n\r\nThis gem requires Rails 3.2+ and has been tested on the following versions:\r\n\r\n* 3.2\r\n\r\nThis gem has been tested against the following Ruby versions:\r\n\r\n* MRI 1.9.2\r\n* MRI 1.9.3\r\n* JRuby 1.6+ (with `JRUBY_OPTS=--1.9`)\r\n* Rubinius 2.0.0dev (with `RBXOPT=-X19`)\r\n\r\nThis gem has been tested against the following database versions:\r\n\r\n* MySQL 5.0, 5.5\r\n* PostgreSQL 9.1, 9.2\r\n* SQLite 3\r\n\r\n\r\n## Installation\r\n\r\nAdd this line to your application's Gemfile:\r\n\r\n``` ruby\r\ngem \"thincloud-authentication\"\r\n```\r\n\r\n* Run `bundle`\r\n* Copy the migrations and prepare your databases:\r\n\r\n```\r\n$ rake thincloud_authentication:install:migrations db:migrate db:test:prepare\r\n```\r\n\r\n* Mount the engine in your `config/routes.rb` file:\r\n\r\n```ruby\r\nmount Thincloud::Authentication::Engine => \"/auth\", as: \"auth_engine\"\r\n```\r\n\r\nUsing the example above, you may now login or signup at [http://lvh.me:3000/auth](http://lvh.me:3000/auth).\r\n\r\n### Prerequisites\r\n\r\nThe following must be true for `thincloud-authentication` to operate properly:\r\n\r\n* A `root_url` must be defined in `config/routes.rb`\r\n* A `User` model must exist\r\n\r\n\r\n## Configuration\r\n\r\nThe `Thincloud::Authentication` module accepts a `configure` block with options to customize the engine behavior.\r\n\r\n\r\n### Layouts\r\n\r\nSet the `layout` option to customize the layout used by all thincloud-authentication views:\r\n\r\n```ruby\r\nThincloud::Authentication.configure do |config|\r\n config.layout = \"other\"\r\nend\r\n```\r\n\r\n### Mailers\r\n\r\nSet the `mailer_sender` option to customize the \"From\" address of the emails sent from the system:\r\n\r\n```ruby\r\nThincloud::Authentication.configure do |config|\r\n config.mailer_sender = \"app@example.com\"\r\nend\r\n```\r\n\r\n\r\n### Additional provider strategies\r\n\r\n* Require the `omniauth-#{provider}` gem before the `thincloud-authentication` gem in the `Gemfile`:\r\n\r\n```ruby\r\ngem \"omniauth-linkedin\"\r\ngem \"omniauth-stripe-connect\"\r\ngem \"thincloud-authentication\"\r\n```\r\n\r\n* Add a key to the `providers` hash with the name of the strategy, followed by additional options for `require`, `scopes` and `fields` as needed. Additionally, you will need to provide environment variables (prefixed with the provider name), with the `consumer_key` and `consumer_secret` values from your OAuth provider.\r\n\r\nTo enable the [LinkedIn](https://github.com/skorks/omniauth-linkedin) and [Stripe Connect](https://github.com/isaacsanders/omniauth-stripe-connect) providers:\r\n\r\n* Provide values for following environment variables:\r\n * `ENV[\"LINKEDIN_CONSUMER_KEY\"]`\r\n * `ENV[\"LINKEDIN_CONSUMER_SECRET\"]`\r\n * `ENV[\"STRIPE_CONNECT_CONSUMER_KEY\"]`\r\n * `ENV[\"STRIPE_CONNECT_CONSUMER_SECRET\"]`\r\n* Add the file `config/initializers/thincloud_authentication.rb` with the following contents:\r\n\r\n```ruby\r\nThincloud::Authentication.configure do |config|\r\n config.providers = {\r\n linkedin: {\r\n scopes: \"r_emailaddress r_basicprofile\",\r\n fields: [\"id\", \"email-address\", \"first-name\", \"last-name\", \"headline\",\r\n \"industry\", \"picture-url\", \"location\", \"public-profile-url\"]\r\n },\r\n stripe_connect: {\r\n require: \"omniauth-stripe-connect\",\r\n scopes: \"read_write\"\r\n }\r\n }\r\nend\r\n```\r\n\r\n\r\n### Vanity Routes\r\n\r\nIf you want to customize the routes (remove the `/auth` prefix), you may add the following to your `config/routes.rb` file:\r\n\r\n```ruby\r\nget \"signup\", to: \"thincloud/authentication/registrations#new\", as: \"signup\"\r\nget \"login\", to: \"thincloud/authentication/sessions#new\", as: \"login\"\r\ndelete \"logout\", to: \"thincloud/authentication/sessions#destroy\", as: \"logout\"\r\n```\r\n\r\nUsing the example above, you will have the following routes locally:\r\n\r\n* `signup_url` points to \"/signup\"\r\n* `login_url` points to \"/login\"\r\n* `logout_url` points to \"/logout\" - Make sure to use the `delete` method to logout.\r\n\r\n\r\n### Redirection\r\n\r\nYou can customize the paths used to redirect users after login, logout and registration by overriding the corresponding methods in your ApplicationController, or specific controllers, as needed.\r\n\r\n* `after_login_path` is used after the user logs in.\r\n* `after_logout_path` is used after the user logs out.\r\n* `after_registration_path` is used after the user registers.\r\n\r\n\r\n## TODO\r\n\r\n* Add \"forgot password\" functionality\r\n* Add multiple, configurable strategy options\r\n* Add a configuration option to customize the mailers\r\n\r\n\r\n## Contributing\r\n\r\n1. [Fork it](https://github.com/newleaders/thincloud-authentication/fork_select)\r\n2. Create your feature branch (`git checkout -b my-new-feature`)\r\n3. Commit your changes (`git commit -am 'Added some feature'`)\r\n4. Push to the branch (`git push origin my-new-feature`)\r\n5. [Create a Pull Request](https://github.com/newleaders/thincloud-authentication/pull/new)\r\n\r\n\r\n## License\r\n\r\n* Freely distributable and licensed under the [MIT license](http://newleaders.mit-license.org/2012/license.html).\r\n* Copyright (c) 2012 New Leaders ([opensource@newleaders.com](opensource@newleaders.com))\r\n* [https://newleaders.com](https://newleaders.com)\r\n"}
Please sign in to comment.
Something went wrong with that request. Please try again.