omniauth-fidbacks 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-fidbacks.gemspec
4
+ gemspec
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,2 @@
1
+ require "omniauth-fidbacks/version"
2
+ require "omniauth/strategies/fidbacks"
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Fidbacks
3
+ VERSION = "0.0.0"
4
+ end
5
+ end
@@ -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
@@ -0,0 +1,2 @@
1
+ require 'omniauth-fidbacks'
2
+ require 'spec_helper'
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: