omniauth-wyngle 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +69 -0
- data/Rakefile +2 -0
- data/lib/omniauth-wyngle.rb +1 -0
- data/lib/omniauth/strategies/wyngle.rb +32 -0
- data/lib/omniauth/wyngle/version.rb +5 -0
- data/omniauth-wyngle.gemspec +24 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 55192d7bab138c350553f4a393f8d27facd87b32
|
4
|
+
data.tar.gz: 1a90c9a5937fee106a42bf75b18800fe45db2f0b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 52e720359c9f02d1bf08e09e4acab0e9a025d6cfbd67377b240adbc59343c332d982c0e5a42714fee5ffff521122bf2bc0d58938e53623d0fe806f24e1347660
|
7
|
+
data.tar.gz: 5bf91e523b803f475c8ee1f8fd846ae0501d2d51566eb5eda19d713ede1637886152410ea8544d969a34351f5227e46796e21424abd64ce49096cc13de5c5475
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
omniauth-wyngle
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.1.2
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Panayotis Matsinopoulos
|
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,69 @@
|
|
1
|
+
# OmniAuth Wyngle
|
2
|
+
|
3
|
+
Wyngle OAuth2 Strategy for OmniAuth.
|
4
|
+
|
5
|
+
Supports the OAuth 2.0 server-side flow.
|
6
|
+
|
7
|
+
## Installing
|
8
|
+
|
9
|
+
Add to your `Gemfile`:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'omniauth-wyngle'
|
13
|
+
```
|
14
|
+
|
15
|
+
Then `bundle install`.
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
`OmniAuth::Strategies::Wyngle` is simply a Rack middleware. [Read the OmniAuth docs for detailed instruction](https://github.com/intridea/omniauth).
|
20
|
+
|
21
|
+
Here's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
25
|
+
provider :wyngle, ENV['WYNGLE_APP_ID'], ENV['WYNGLE_SECRET']
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
[See the example Rails app for full example](https://bitbucket.org/wyngle/ror-eshop).
|
30
|
+
|
31
|
+
## Configuring
|
32
|
+
|
33
|
+
You can configure several options, which you pass in to the `provider` method via a `Hash`:
|
34
|
+
```
|
35
|
+
(... this is under construction ...)
|
36
|
+
```
|
37
|
+
|
38
|
+
## Auth Hash
|
39
|
+
|
40
|
+
Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
{
|
44
|
+
:provider => 'wyngle',
|
45
|
+
:uid => '1234567',
|
46
|
+
:info => {
|
47
|
+
:email => 'joe@bloggs.com',
|
48
|
+
:first_name => 'Joe',
|
49
|
+
:last_name => 'Bloggs',
|
50
|
+
:gender => 'Male'
|
51
|
+
},
|
52
|
+
:credentials => {
|
53
|
+
:token => 'ABCDEF...', # OAuth 2.0 access_token, which you may wish to store
|
54
|
+
:expires_at => 1321747205, # when the access token expires (it always will)
|
55
|
+
:expires => true # this will always be true
|
56
|
+
}
|
57
|
+
}
|
58
|
+
```
|
59
|
+
|
60
|
+
## License
|
61
|
+
|
62
|
+
Copyright (c) 2014 by Wyngle
|
63
|
+
|
64
|
+
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:
|
65
|
+
|
66
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
67
|
+
|
68
|
+
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.
|
69
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "omniauth/strategies/wyngle"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require "omniauth/wyngle/version"
|
2
|
+
require 'omniauth-oauth2'
|
3
|
+
|
4
|
+
module OmniAuth
|
5
|
+
module Strategies
|
6
|
+
class Wyngle < OmniAuth::Strategies::OAuth2
|
7
|
+
DEFAULT_SCOPE = "basic_data"
|
8
|
+
|
9
|
+
# change the class name and the :name option to match your application name
|
10
|
+
option :name, :wyngle
|
11
|
+
|
12
|
+
option :client_options, {
|
13
|
+
:site => "https://www.wyngle.com"
|
14
|
+
}
|
15
|
+
|
16
|
+
uid { raw_info["id"] }
|
17
|
+
|
18
|
+
info do
|
19
|
+
{
|
20
|
+
:email => raw_info["email"],
|
21
|
+
:gender => raw_info["gender"],
|
22
|
+
:first_name => raw_info["first_name"],
|
23
|
+
:last_name => raw_info["last_name"]
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def raw_info
|
28
|
+
@raw_info ||= access_token.get('/api/v1/me.json').parsed
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'omniauth/wyngle/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "omniauth-wyngle"
|
8
|
+
spec.version = Omniauth::Wyngle::VERSION
|
9
|
+
spec.authors = ["Panayotis Matsinopoulos"]
|
10
|
+
spec.email = ["panayotis@matsinopoulos.gr"]
|
11
|
+
spec.summary = %q{Wyngle OAuth2 Strategy for OmniAuth}
|
12
|
+
spec.homepage = "https://bitbucket.org/wyngle/omniauth-wyngle"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
|
23
|
+
spec.add_runtime_dependency 'omniauth-oauth2'
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-wyngle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Panayotis Matsinopoulos
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: omniauth-oauth2
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- panayotis@matsinopoulos.gr
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".ruby-gemset"
|
64
|
+
- ".ruby-version"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- lib/omniauth-wyngle.rb
|
70
|
+
- lib/omniauth/strategies/wyngle.rb
|
71
|
+
- lib/omniauth/wyngle/version.rb
|
72
|
+
- omniauth-wyngle.gemspec
|
73
|
+
homepage: https://bitbucket.org/wyngle/omniauth-wyngle
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.2.2
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Wyngle OAuth2 Strategy for OmniAuth
|
97
|
+
test_files: []
|