omniauth-eivo-oauth2 1.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.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/Gemfile +3 -0
- data/LICENSE.md +19 -0
- data/README.md +29 -0
- data/lib/omniauth-eivo-oauth2.rb +2 -0
- data/lib/omniauth-eivo-oauth2/version.rb +5 -0
- data/lib/omniauth/strategies/eivo.rb +37 -0
- data/omniauth-eivo-oauth2.gemspec +17 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e7bba94f0ca45ce7c66ec4d77badbc61167baa15
|
4
|
+
data.tar.gz: e2b883799849c491e922af6198aa6e82f383b4cf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 644df12ea8cf2b303005af54aff8175bb701afca24cb5c8a581df425aa336734754c3fb9697c207755685236efa9374dd9da6ebb896143dbe57b1c9f4a88eb95
|
7
|
+
data.tar.gz: db3d6df3d5e3e5856684d72196ac75b7ea481b75886e6d074050c000428b7b0976ea863f3260a96f2ae837d302adb949043354cc6c50516ad6a21f905b2d215f
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2016 Jonathan Tribouharet
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# OmniAuth Eivo OAuth2
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/omniauth-eivo-oauth2)
|
4
|
+
|
5
|
+
Strategy to authenticate Eivo in OmniAuth.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
OmniAuth Eivo OAuth2 is distributed as a gem, which is how it should be used in your app.
|
10
|
+
|
11
|
+
Include the gem in your Gemfile:
|
12
|
+
|
13
|
+
gem 'omniauth-eivo-oauth2', '~> 1.0'
|
14
|
+
|
15
|
+
Integrate this strategy to your OmniAuth middleware.
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
19
|
+
provider :eivo, ENV['EIVO_KEY'], ENV['EIVO_SECRET']
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
## Author
|
24
|
+
|
25
|
+
- [Jonathan Tribouharet](https://github.com/jonathantribouharet) ([@johntribouharet](https://twitter.com/johntribouharet))
|
26
|
+
|
27
|
+
## License
|
28
|
+
|
29
|
+
OmniAuth Eivo OAuth2 is released under the MIT license. See the LICENSE file for more info.
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Eivo < OmniAuth::Strategies::OAuth2
|
6
|
+
|
7
|
+
option :name, "eivo"
|
8
|
+
|
9
|
+
option :client_options, { :site => "https://sso.eivo.fr" }
|
10
|
+
|
11
|
+
uid { raw_info['id'] }
|
12
|
+
|
13
|
+
info do
|
14
|
+
{
|
15
|
+
:email => raw_info['email']
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
extra do
|
20
|
+
{
|
21
|
+
'raw_info' => raw_info
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def raw_info
|
26
|
+
@raw_info ||= access_token.get('/api/v1/me.json').parsed
|
27
|
+
end
|
28
|
+
|
29
|
+
# Required for omniauth-oauth2 >= 1.4
|
30
|
+
# https://github.com/intridea/omniauth-oauth2/issues/81
|
31
|
+
def callback_url
|
32
|
+
full_host + script_name + callback_path
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.expand_path("../lib/omniauth-eivo-oauth2/version", __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = "omniauth-eivo-oauth2"
|
5
|
+
gem.summary = "OmniAuth Strategy for EIVO via OAuth2"
|
6
|
+
gem.description = "OmniAuth Strategy for EIVO via OAuth2"
|
7
|
+
gem.homepage = "https://github.com/jonathantribouharet/omniauth-eivo-oauth2"
|
8
|
+
gem.version = OmniAuth::Eivo::VERSION
|
9
|
+
gem.files = `git ls-files`.split("\n")
|
10
|
+
gem.require_paths = ["lib"]
|
11
|
+
gem.authors = ['Jonathan TRIBOUHARET']
|
12
|
+
gem.email = 'jonathan.tribouharet@gmail.com'
|
13
|
+
gem.license = 'MIT'
|
14
|
+
gem.platform = Gem::Platform::RUBY
|
15
|
+
|
16
|
+
gem.add_dependency 'omniauth-oauth2', '~> 1.4'
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-eivo-oauth2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonathan TRIBOUHARET
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth-oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
description: OmniAuth Strategy for EIVO via OAuth2
|
28
|
+
email: jonathan.tribouharet@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- .gitignore
|
34
|
+
- Gemfile
|
35
|
+
- LICENSE.md
|
36
|
+
- README.md
|
37
|
+
- lib/omniauth-eivo-oauth2.rb
|
38
|
+
- lib/omniauth-eivo-oauth2/version.rb
|
39
|
+
- lib/omniauth/strategies/eivo.rb
|
40
|
+
- omniauth-eivo-oauth2.gemspec
|
41
|
+
homepage: https://github.com/jonathantribouharet/omniauth-eivo-oauth2
|
42
|
+
licenses:
|
43
|
+
- MIT
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 2.0.14.1
|
62
|
+
signing_key:
|
63
|
+
specification_version: 4
|
64
|
+
summary: OmniAuth Strategy for EIVO via OAuth2
|
65
|
+
test_files: []
|