omniauth-inspire9 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +1 -0
- data/lib/omniauth/inspire9.rb +2 -0
- data/lib/omniauth/strategies/inspire9.rb +38 -0
- data/omniauth-inspire9.gemspec +15 -0
- metadata +51 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fccd4a967176edb950d47dab246f47a89caee4d9
|
4
|
+
data.tar.gz: 1bb7efae92e7b97180ec1e4bd38be540665d0218
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 755318c086d41e698505147545223900a399a18c69a3dbbd2eb4848b2d1a0887af3a063515f8562e285cf2513816bd9de2c62b0464da9dd447c34fd4f039f0b7
|
7
|
+
data.tar.gz: f2919847a5c810406d6bc55e94e39e8d983a7932a47fe7defdc2770d783dcb3d12150124ee3e2382f6643829220ecb88e819d81d9033ec708299c1fb5797d3ab
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Pat Allan and Inspire9
|
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,31 @@
|
|
1
|
+
# OmniAuth Client for Inspire9's Identity Server
|
2
|
+
|
3
|
+
At this point in time, I don't see this being used for anything outside of Inspire9 projects, but it's open source at least as a proof-of-concept. It's not like there's a great deal of code here though. The server side is much more interesting (and perhaps that'll become open as well).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
It's a gem, so you'll likely want to put this line in your Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'omniauth-inspire9', '~> 0.0.1'
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
If you're using OmniAuth directly, you'll want to add the middleware with something along these lines:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
19
|
+
provider :inspire9, APP_ID, APP_SECRET
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
Or with Devise, in `config/initializers/devise.rb`:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
config.omniauth :inspire9, APP_ID, APP_SECRET
|
27
|
+
```
|
28
|
+
|
29
|
+
## Licence
|
30
|
+
|
31
|
+
Copyright (c) 2013, omniauth-inspire9 is developed and maintained by Pat Allan and Inspire9, and is released under the open MIT Licence.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module OmniAuth
|
2
|
+
module Strategies
|
3
|
+
class Inspire9 < OmniAuth::Strategies::OAuth2
|
4
|
+
DEFAULT_PROVIDER_URL = 'https://identity.inspire9.com'
|
5
|
+
|
6
|
+
option :client_options, {
|
7
|
+
:site => DEFAULT_PROVIDER_URL,
|
8
|
+
:authorize_url => "#{DEFAULT_PROVIDER_URL}/access/authorize",
|
9
|
+
:access_token_url => "#{DEFAULT_PROVIDER_URL}/access/token"
|
10
|
+
}
|
11
|
+
option :provider_ignores_state, true
|
12
|
+
|
13
|
+
uid { raw_info['id'] }
|
14
|
+
|
15
|
+
info do
|
16
|
+
raw_info['info']
|
17
|
+
end
|
18
|
+
|
19
|
+
extra do
|
20
|
+
raw_info['extra']
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def extra
|
26
|
+
raw_info['extra']
|
27
|
+
end
|
28
|
+
|
29
|
+
def raw_info
|
30
|
+
@raw_info ||= access_token.get(raw_path).parsed
|
31
|
+
end
|
32
|
+
|
33
|
+
def raw_path
|
34
|
+
"/access/user.json?oauth_token=#{access_token.token}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
Gem::Specification.new do |spec|
|
3
|
+
spec.name = 'omniauth-inspire9'
|
4
|
+
spec.version = '0.0.1'
|
5
|
+
spec.authors = 'Pat Allan'
|
6
|
+
spec.email = 'pat@freelancing-gods.com'
|
7
|
+
spec.summary = %q{OmniAuth client library for inspire9.com}
|
8
|
+
spec.description = %q{An OmniAuth client libary for Inspire9's identity server.}
|
9
|
+
spec.homepage = 'https://github.com/inspire9/omniauth-inspire9'
|
10
|
+
spec.license = 'MIT'
|
11
|
+
|
12
|
+
spec.files = `git ls-files`.split($/)
|
13
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
14
|
+
spec.require_paths = ['lib']
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-inspire9
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pat Allan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: An OmniAuth client libary for Inspire9's identity server.
|
14
|
+
email: pat@freelancing-gods.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- .gitignore
|
20
|
+
- Gemfile
|
21
|
+
- LICENSE.txt
|
22
|
+
- README.md
|
23
|
+
- Rakefile
|
24
|
+
- lib/omniauth/inspire9.rb
|
25
|
+
- lib/omniauth/strategies/inspire9.rb
|
26
|
+
- omniauth-inspire9.gemspec
|
27
|
+
homepage: https://github.com/inspire9/omniauth-inspire9
|
28
|
+
licenses:
|
29
|
+
- MIT
|
30
|
+
metadata: {}
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubyforge_project:
|
47
|
+
rubygems_version: 2.1.2
|
48
|
+
signing_key:
|
49
|
+
specification_version: 4
|
50
|
+
summary: OmniAuth client library for inspire9.com
|
51
|
+
test_files: []
|