omniauth-snowflake 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/Gemfile.lock +37 -0
- data/README.md +4 -0
- data/lib/omniauth/strategies/snowflake.rb +33 -0
- data/lib/omniauth-snowflake/version.rb +5 -0
- data/lib/omniauth-snowflake.rb +2 -0
- data/omniauth-snowflake.gemspec +19 -0
- metadata +84 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
omniauth-snowflake (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 (2.0.5)
|
14
|
+
httpauth (0.2.0)
|
15
|
+
jwt (0.1.8)
|
16
|
+
multi_json (>= 1.5)
|
17
|
+
multi_json (1.7.6)
|
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.4)
|
26
|
+
hashie (>= 1.2, < 3)
|
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-snowflake!
|
data/README.md
ADDED
@@ -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://snowflake.icisapp.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 => raw_info['clinical_role'] }
|
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-snowflake/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Patrick Robertson"]
|
6
|
+
gem.email = ["rubygems@iorahealth.com"]
|
7
|
+
gem.description = %q{Omniauth Strategy for Iora's OAuth provider, Snowflake}
|
8
|
+
gem.summary = %q{Omniauth Strategy for Snowflake}
|
9
|
+
gem.homepage = "https://github.com/iorahealth/omniauth-snowflake"
|
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-snowflake"
|
14
|
+
gem.require_paths = ["lib"]
|
15
|
+
gem.version = OmniAuth::Snowflake::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-snowflake
|
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-06-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: Omniauth Strategy for Iora's OAuth provider, Snowflake
|
47
|
+
email:
|
48
|
+
- rubygems@iorahealth.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- Gemfile
|
54
|
+
- Gemfile.lock
|
55
|
+
- README.md
|
56
|
+
- lib/omniauth-snowflake.rb
|
57
|
+
- lib/omniauth-snowflake/version.rb
|
58
|
+
- lib/omniauth/strategies/snowflake.rb
|
59
|
+
- omniauth-snowflake.gemspec
|
60
|
+
homepage: https://github.com/iorahealth/omniauth-snowflake
|
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.23
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: Omniauth Strategy for Snowflake
|
84
|
+
test_files: []
|