omniauth-thecity 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 312c6654746cb1c428df7b35af63e5998e2ea8ee
4
- data.tar.gz: ef00eca5182724d46d59d82201f9838428fcd148
3
+ metadata.gz: 0ef1f6ca2d04f19825de6df66da44858cdea2146
4
+ data.tar.gz: 42128cb835c4f7d5556f0ac739d0939d0c48b2e3
5
5
  SHA512:
6
- metadata.gz: 1e0e978e99c5a5aef901a19df0209537c0183a61264cac8dedf3bbda65fa0b37a0b5c452d3851f27f75a0dba9ab6115520dbe990019b31c8cc80a9d5080f213a
7
- data.tar.gz: 075dee350e0371e7de0c2fcf92d220fe586fba7dc7f2898f97dc23f53b2dffe75760017aa3a2a7cfc273e8bc5b94927b63200d06625889a9286ed5a5d6aeac12
6
+ metadata.gz: 7b44be598fda2c028e0150fa1720c4db1b78e1307b937a3c00dc916f358bca5b9617eb7b876a00662bf7c785ae53e52f688dbbf03f7584554c62bb7a22e9116f
7
+ data.tar.gz: 8c575b464dc6c2c6c2837f51b6bcef38ba9ec8d901b1cc9cd070db062795a25ae143f569544fb948ebafe9c328bbf78e2daac8d3e009ac7974737579869447f1
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Omniauth::Thecity
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/omniauth-thecity.png)](http://badge.fury.io/rb/omniauth-thecity)
4
+ [![Dependency Status](https://gemnasium.com/thecity/omniauth-thecity.png)](https://gemnasium.com/thecity/omniauth-thecity)
4
5
 
5
6
  This gem contains The City strategy for OmniAuth.
6
7
 
@@ -30,6 +31,33 @@ Rails.application.config.middleware.use OmniAuth::Builder do
30
31
  end
31
32
  ```
32
33
 
34
+ ### The City subdomains
35
+
36
+ City users have one global user, and then a local user for each subdomain (City) they have an active account.
37
+
38
+ When a user successfully authenticates, omnniauth-thecity returns an array of local users belonging to the City global user. If you pass along a subdomain, The City authentication service will only return an active local user for the subdomain you passed in.
39
+
40
+ If your app only cares about one City subdomain (e.g. gracechurch.onthecity.org ), you can configure omniauth-thecity globally like this:
41
+ ```ruby
42
+ Rails.application.config.middleware.use OmniAuth::Builder do
43
+ provider :thecity, "APPID", "SECRET", :scope => 'user_basic user_extended', :subdomain => 'gracechurch'}
44
+ end
45
+ ```
46
+
47
+ Otherwise, you can set the subdomain per request as a query parameter, or header.
48
+
49
+ For example, when using [devise](https://github.com/plataformatec/devise) you can pass the subdomain using the route helper:
50
+
51
+ ```ruby
52
+ user_omniauth_authorize_path(:thecity, params: {subdomain: 'gracechurch'})
53
+ ```
54
+
55
+ or as a custom header in your request:
56
+
57
+ ```
58
+ X_THECITY_SUBDOMAIN: gracechurch
59
+ ```
60
+
33
61
  ## Authentication Hash
34
62
  An example auth hash available in `request.env['omniauth.auth']`:
35
63
 
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module TheCity
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ module OmniAuth
25
25
  end
26
26
 
27
27
  def subdomain
28
- options.subdomain ||= request.params["subdomain"] || request.headers['HTTP_X_CITY_SUBDOMAIN'] || nil rescue nil
28
+ options.subdomain ||= request.params["subdomain"] || request.headers['HTTP_X_THECITY_SUBDOMAIN'] || nil rescue nil
29
29
  end
30
30
 
31
31
  uid do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-thecity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Blair