omniauth-opinionage 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/Gemfile +3 -0
- data/README.md +41 -0
- data/lib/omniauth/opinionage/version.rb +5 -0
- data/lib/omniauth/opinionage.rb +2 -0
- data/lib/omniauth/strategies/opinionage.rb +26 -0
- data/lib/omniauth-opinionage.rb +1 -0
- data/omniauth-opinionage.gemspec +22 -0
- metadata +83 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# OmniAuth strategy for Opinionage
|
2
|
+
|
3
|
+
Opinionage OAuth2 Strategy (it requires OmniAuth > 1.0)
|
4
|
+
|
5
|
+
## Installing
|
6
|
+
|
7
|
+
Add to your `Gemfile`:
|
8
|
+
|
9
|
+
```
|
10
|
+
ruby
|
11
|
+
gem 'omniauth-opinionage'
|
12
|
+
```
|
13
|
+
|
14
|
+
Then `bundle install`.
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
`OmniAuth::Strategies::Opinionage` is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.
|
19
|
+
|
20
|
+
Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
24
|
+
provider :facebook, ENV['OPINIONAGE_KEY'], ENV['OPINIONAGE_SECRET']
|
25
|
+
end
|
26
|
+
```
|
27
|
+
|
28
|
+
## Configuring
|
29
|
+
|
30
|
+
You can configure the authorization scope, which is a comma-separated list of permissions you want to request from the user.
|
31
|
+
|
32
|
+
See the Opinionage docs for a full list of available permissions: http://developer.opinionage.com/oauth/scopes/
|
33
|
+
|
34
|
+
## License
|
35
|
+
Copyright (c) 2012 by Opinionage Inc.
|
36
|
+
|
37
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
38
|
+
|
39
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
40
|
+
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Opinionage < OmniAuth::Strategies::OAuth2
|
6
|
+
|
7
|
+
option :client_options, { :site => "https://opinionage.com",
|
8
|
+
:authorize_url => "/auth/authorize",
|
9
|
+
:token_url => "/auth/token",
|
10
|
+
}
|
11
|
+
|
12
|
+
option :token_params, {
|
13
|
+
:parse => :json
|
14
|
+
}
|
15
|
+
|
16
|
+
extra do
|
17
|
+
{
|
18
|
+
:credentials => {
|
19
|
+
:access_token => access_token.token
|
20
|
+
}
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'omniauth/opinionage'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'omniauth/opinionage/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'omniauth-opinionage'
|
7
|
+
s.version = OmniAuth::Opinionage::VERSION
|
8
|
+
s.authors = ['Carlo Alberto Degli Atti']
|
9
|
+
s.email = ['lordkada@opinionage.com']
|
10
|
+
s.summary = 'Opinionage strategy for OmniAuth'
|
11
|
+
s.description = "This library allows to plug in the Opinionage's strategy for OmniAuth"
|
12
|
+
s.homepage = 'https://github.com/opinionage/omniauth-opinionage'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
17
|
+
s.require_paths = ['lib']
|
18
|
+
|
19
|
+
s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
|
20
|
+
|
21
|
+
s.add_development_dependency 'rake'
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-opinionage
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Carlo Alberto Degli Atti
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2012-08-07 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: omniauth-oauth2
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "1.1"
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rake
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id002
|
37
|
+
description: This library allows to plug in the Opinionage's strategy for OmniAuth
|
38
|
+
email:
|
39
|
+
- lordkada@opinionage.com
|
40
|
+
executables: []
|
41
|
+
|
42
|
+
extensions: []
|
43
|
+
|
44
|
+
extra_rdoc_files: []
|
45
|
+
|
46
|
+
files:
|
47
|
+
- .gitignore
|
48
|
+
- Gemfile
|
49
|
+
- README.md
|
50
|
+
- lib/omniauth-opinionage.rb
|
51
|
+
- lib/omniauth/opinionage.rb
|
52
|
+
- lib/omniauth/opinionage/version.rb
|
53
|
+
- lib/omniauth/strategies/opinionage.rb
|
54
|
+
- omniauth-opinionage.gemspec
|
55
|
+
homepage: https://github.com/opinionage/omniauth-opinionage
|
56
|
+
licenses: []
|
57
|
+
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
60
|
+
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: "0"
|
75
|
+
requirements: []
|
76
|
+
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 1.8.24
|
79
|
+
signing_key:
|
80
|
+
specification_version: 3
|
81
|
+
summary: Opinionage strategy for OmniAuth
|
82
|
+
test_files: []
|
83
|
+
|