omniauth-icis 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,37 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-icis (0.1.0)
5
+ omniauth (~> 1.0)
6
+ omniauth-oauth2 (~> 1.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ faraday (0.8.7)
12
+ multipart-post (~> 1.1)
13
+ hashie (1.2.0)
14
+ httpauth (0.2.0)
15
+ jwt (0.1.8)
16
+ multi_json (>= 1.5)
17
+ multi_json (1.7.2)
18
+ multipart-post (1.2.0)
19
+ oauth2 (0.8.1)
20
+ faraday (~> 0.8)
21
+ httpauth (~> 0.1)
22
+ jwt (~> 0.1.4)
23
+ multi_json (~> 1.0)
24
+ rack (~> 1.2)
25
+ omniauth (1.1.3)
26
+ hashie (~> 1.2)
27
+ rack
28
+ omniauth-oauth2 (1.1.1)
29
+ oauth2 (~> 0.8.0)
30
+ omniauth (~> 1.0)
31
+ rack (1.5.2)
32
+
33
+ PLATFORMS
34
+ ruby
35
+
36
+ DEPENDENCIES
37
+ omniauth-icis!
@@ -0,0 +1,4 @@
1
+ OMNIAUTH-ICIS
2
+ =============
3
+
4
+ OmniAuth strategy for the example ICIS OAuth provider.
@@ -0,0 +1,2 @@
1
+ require 'omniauth-icis/version'
2
+ require 'omniauth/strategies/icis'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Icis
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require 'omniauth'
2
+ require 'omniauth-oauth2'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Icis < OmniAuth::Strategies::OAuth2
7
+ option :client_options, { :site => 'https://icis-identity-example.herokuapp.com' }
8
+
9
+ uid { raw_info["uid"] }
10
+
11
+ info {
12
+ { :email => raw_info['email'],
13
+ :first_name => raw_info['first_name'],
14
+ :last_name => raw_info['last_name'],
15
+ :role => 'staff' }
16
+ }
17
+
18
+ def authorize_params
19
+ super.tap do |params|
20
+ if request.params['state']
21
+ params[:state] = request.params['state']
22
+
23
+ session['omniauth.state'] = params[:state]
24
+ end
25
+ end
26
+ end
27
+
28
+ def raw_info
29
+ @raw_info ||= access_token.get('/api/v1/me.json').parsed
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/omniauth-icis/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Patrick Robertson"]
6
+ gem.email = ["patricksrobertson@gmail.com"]
7
+ gem.description = %q{Example OmniAuth strategy for ICIS}
8
+ gem.summary = %q{Example OmniAuth strategy for ICIS}
9
+ gem.homepage = "https://github.com/patricksrobertson/omniauth-icis"
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.name = "omniauth-icis"
14
+ gem.require_paths = ["lib"]
15
+ gem.version = OmniAuth::Icis::VERSION
16
+
17
+ gem.add_dependency 'omniauth', '~> 1.0'
18
+ gem.add_dependency 'omniauth-oauth2', '~> 1.1'
19
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-icis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Patrick Robertson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
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'
30
+ - !ruby/object:Gem::Dependency
31
+ name: omniauth-oauth2
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.1'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.1'
46
+ description: Example OmniAuth strategy for ICIS
47
+ email:
48
+ - patricksrobertson@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - Gemfile
54
+ - Gemfile.lock
55
+ - README.md
56
+ - lib/omniauth-icis.rb
57
+ - lib/omniauth-icis/version.rb
58
+ - lib/omniauth/strategies/icis.rb
59
+ - omniauth-icis.gemspec
60
+ homepage: https://github.com/patricksrobertson/omniauth-icis
61
+ licenses: []
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 1.8.24
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: Example OmniAuth strategy for ICIS
84
+ test_files: []