omniauth-empireavenue 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
CHANGED
@@ -27,13 +27,16 @@ Here's a quick example, adding the middleware to a Rails app in
|
|
27
27
|
|
28
28
|
```ruby
|
29
29
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
30
|
-
provider :empireavenue, ENV['
|
30
|
+
provider :empireavenue, ENV['CLIENT_KEY'], ENV['CLIENT_SECRET']
|
31
31
|
end
|
32
32
|
```
|
33
33
|
You can then implement your authentication as usual with OmniAuth as
|
34
34
|
shown in the excellent [Railscast
|
35
35
|
241](http://railscasts.com/episodes/241-simple-omniauth)
|
36
36
|
|
37
|
+
Do to cross domain issues the authentication hash is not constructed in this
|
38
|
+
version.
|
39
|
+
|
37
40
|
##Authentication Hash
|
38
41
|
|
39
42
|
Here's an example *Authentication Hash* available in
|
@@ -44,7 +47,7 @@ Here's an example *Authentication Hash* available in
|
|
44
47
|
|
45
48
|
## License
|
46
49
|
|
47
|
-
Copyright (c)
|
50
|
+
Copyright (c) 2013 by Ralph Janke
|
48
51
|
|
49
52
|
Permission is hereby granted, free of charge, to any person obtaining a
|
50
53
|
copy of this software and associated documentation files (the
|
@@ -17,19 +17,13 @@ module OmniAuth
|
|
17
17
|
}
|
18
18
|
|
19
19
|
def request_phase
|
20
|
-
|
20
|
+
redirect client.auth_code.authorize_url({:state => "request_auth_code", :response_type => "code"})
|
21
21
|
end
|
22
22
|
|
23
|
-
uid{
|
23
|
+
uid { access_token.params }
|
24
24
|
|
25
25
|
info do
|
26
26
|
{
|
27
|
-
:ticker => raw_info['ticker'],
|
28
|
-
:first_name => raw_info['first_name'],
|
29
|
-
:last_name => raw_info['last_name'],
|
30
|
-
:full_name => raw_info['full_name'],
|
31
|
-
:ticker => raw_info['ticker'],
|
32
|
-
:location => [raw_info['location'], raw_info['country']].reject{|v| !v || v.empty?}.join(', ')
|
33
27
|
}
|
34
28
|
end
|
35
29
|
|
@@ -38,9 +32,11 @@ module OmniAuth
|
|
38
32
|
end
|
39
33
|
|
40
34
|
def raw_info
|
41
|
-
@raw_info
|
35
|
+
@raw_info = {}
|
42
36
|
end
|
43
37
|
|
44
38
|
end
|
45
39
|
end
|
46
40
|
end
|
41
|
+
|
42
|
+
OmniAuth.config.add_camelization 'empireavenue', 'EmpireAvenue'
|
@@ -24,29 +24,4 @@ describe OmniAuth::Strategies::EmpireAvenue do
|
|
24
24
|
subject.callback_path.should eq('/auth/empireavenue/callback')
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
28
|
-
describe '#uid' do
|
29
|
-
it 'returns the uid from raw_info' do
|
30
|
-
subject.stub(:raw_info) { { 'ticker' => 'txwikinger' } }
|
31
|
-
subject.uid.should == 'txwikinger'
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe '#first_name' do
|
36
|
-
it 'returns the name from raw_info' do
|
37
|
-
subject.stub(:raw_info) { { 'first_name' => 'Bert' }}
|
38
|
-
subject.info[:first_name].should == 'Bert'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'returns the last_name from raw_info' do
|
42
|
-
subject.stub(:raw_info) { { 'last_name' => 'Vogts' }}
|
43
|
-
subject.info[:last_name].should == 'Vogts'
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'returns the full name from raw_info' do
|
47
|
-
subject.stub(:raw_info) { { 'full_name' => 'Berti Vogts' }}
|
48
|
-
subject.info[:full_name].should == 'Berti Vogts'
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-empireavenue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -124,7 +124,6 @@ files:
|
|
124
124
|
- lib/omniauth-empireavenue/version.rb
|
125
125
|
- lib/omniauth/strategies/empireavenue.rb
|
126
126
|
- omniauth-empireavenue.gemspec
|
127
|
-
- spec/omniauth/strategies/.empireavenue_spec.rb.swp
|
128
127
|
- spec/omniauth/strategies/empireavenue_spec.rb
|
129
128
|
- spec/spec_helper.rb
|
130
129
|
homepage: http://github.com/txwikinger/omniauth-empireavenue
|
Binary file
|