omniauth-fidbacks 0.0.0
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/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +38 -0
- data/Rakefile +1 -0
- data/lib/omniauth-fidbacks.rb +2 -0
- data/lib/omniauth-fidbacks/version.rb +5 -0
- data/lib/omniauth/strategies/fidbacks.rb +38 -0
- data/omniauth-fidbacks.gemspec +22 -0
- data/spec/omniauth/strategies/omniauth_fidbacks_spec.rb +2 -0
- data/spec/spec_helper.rb +0 -0
- metadata +107 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2013 Projet H
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Omniauth::Fidbacks
|
|
2
|
+
|
|
3
|
+
A Fidbacks OAuth2 strategy for OmniAuth.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'omniauth-fidbacks'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install omniauth-fidbacks
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Register your application with Fidbacks to receive an API key: https://partner.fidbacks.com/
|
|
22
|
+
|
|
23
|
+
This is an example that you might put into a Rails initializer at `config/initializers/omniauth.rb`:
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
27
|
+
provider :fidbacks, ENV['FIDBACKS_KEY'], ENV['FIDBACKS_SECRET']
|
|
28
|
+
end
|
|
29
|
+
```
|
|
30
|
+
You can now access the OmniAuth Fidbacks OAuth2 URL: `/auth/fidbacks`.
|
|
31
|
+
|
|
32
|
+
## Contributing
|
|
33
|
+
|
|
34
|
+
1. Fork it
|
|
35
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
36
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
37
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
38
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require 'omniauth-oauth2'
|
|
2
|
+
|
|
3
|
+
module Omniauth
|
|
4
|
+
module Strategies
|
|
5
|
+
class Fidbacks < OmniAuth::Strategies::OAuth2
|
|
6
|
+
# Give your strategy a name.
|
|
7
|
+
option :name, 'fidbacks'
|
|
8
|
+
|
|
9
|
+
# This is where you pass the options you would pass when
|
|
10
|
+
# initializing your consumer from the OAuth gem.
|
|
11
|
+
option :client_options, {
|
|
12
|
+
:site => ENV['API_FIDBACKS_URL'] || 'http://api.fidbacks.com',
|
|
13
|
+
:authorize_url => '/oauth/authorize'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
# option :scope, 'r_basicprofile r_emailaddress'
|
|
17
|
+
# option :fields, ['id', 'email-address', 'first-name', 'last-name', 'headline', 'location', 'industry', 'picture-url', 'public-profile-url']
|
|
18
|
+
|
|
19
|
+
# These are called after authentication has succeeded. If
|
|
20
|
+
# possible, you should try to set the UID without making
|
|
21
|
+
# additional calls (if the user id is returned with the token
|
|
22
|
+
# or as a URI parameter). This may not be possible with all
|
|
23
|
+
# providers.
|
|
24
|
+
uid { raw_info['pseudo'] }
|
|
25
|
+
|
|
26
|
+
info do
|
|
27
|
+
{
|
|
28
|
+
name: raw_info["name"],
|
|
29
|
+
email: raw_info["email"]
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def raw_info
|
|
34
|
+
@raw_info ||= access_token.get("/api/v1/me.json").parsed
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'omniauth-fidbacks/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |gem|
|
|
7
|
+
gem.name = "omniauth-fidbacks"
|
|
8
|
+
gem.version = Omniauth::Fidbacks::VERSION
|
|
9
|
+
gem.authors = ["Thomas Bancel"]
|
|
10
|
+
gem.email = ["bancel.thomas@gmail.com"]
|
|
11
|
+
gem.summary = %q{Fidbacks strategy for OmniAuth}
|
|
12
|
+
gem.homepage = "https://github.com/projeth/omniauth-fidbacks"
|
|
13
|
+
|
|
14
|
+
gem.files = `git ls-files`.split($/)
|
|
15
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
17
|
+
gem.require_paths = ["lib"]
|
|
18
|
+
|
|
19
|
+
gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.0.2'
|
|
20
|
+
gem.add_development_dependency 'rspec', '~> 2'
|
|
21
|
+
gem.add_development_dependency 'rake'
|
|
22
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
File without changes
|
metadata
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: omniauth-fidbacks
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Thomas Bancel
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: omniauth-oauth2
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.0.2
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 1.0.2
|
|
30
|
+
- !ruby/object:Gem::Dependency
|
|
31
|
+
name: rspec
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
34
|
+
requirements:
|
|
35
|
+
- - ~>
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '2'
|
|
38
|
+
type: :development
|
|
39
|
+
prerelease: false
|
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ~>
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '2'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rake
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ! '>='
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
type: :development
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ! '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
description:
|
|
63
|
+
email:
|
|
64
|
+
- bancel.thomas@gmail.com
|
|
65
|
+
executables: []
|
|
66
|
+
extensions: []
|
|
67
|
+
extra_rdoc_files: []
|
|
68
|
+
files:
|
|
69
|
+
- .gitignore
|
|
70
|
+
- Gemfile
|
|
71
|
+
- LICENSE.txt
|
|
72
|
+
- README.md
|
|
73
|
+
- Rakefile
|
|
74
|
+
- lib/omniauth-fidbacks.rb
|
|
75
|
+
- lib/omniauth-fidbacks/version.rb
|
|
76
|
+
- lib/omniauth/strategies/fidbacks.rb
|
|
77
|
+
- omniauth-fidbacks.gemspec
|
|
78
|
+
- spec/omniauth/strategies/omniauth_fidbacks_spec.rb
|
|
79
|
+
- spec/spec_helper.rb
|
|
80
|
+
homepage: https://github.com/projeth/omniauth-fidbacks
|
|
81
|
+
licenses: []
|
|
82
|
+
post_install_message:
|
|
83
|
+
rdoc_options: []
|
|
84
|
+
require_paths:
|
|
85
|
+
- lib
|
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
|
+
none: false
|
|
88
|
+
requirements:
|
|
89
|
+
- - ! '>='
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: '0'
|
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
|
+
none: false
|
|
94
|
+
requirements:
|
|
95
|
+
- - ! '>='
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '0'
|
|
98
|
+
requirements: []
|
|
99
|
+
rubyforge_project:
|
|
100
|
+
rubygems_version: 1.8.24
|
|
101
|
+
signing_key:
|
|
102
|
+
specification_version: 3
|
|
103
|
+
summary: Fidbacks strategy for OmniAuth
|
|
104
|
+
test_files:
|
|
105
|
+
- spec/omniauth/strategies/omniauth_fidbacks_spec.rb
|
|
106
|
+
- spec/spec_helper.rb
|
|
107
|
+
has_rdoc:
|