omniauth-cohabitat-user 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c367aa26fd441f3c676606a52c5c1ed2a946aed6
4
+ data.tar.gz: 954cf16a4ebb42bdac3ccb68f01e792aee77c51a
5
+ SHA512:
6
+ metadata.gz: 14eb39aa0c1c128e1110f9443fa17137fa656d17decb5765d41ba9f752d90eec9a1d8f7fa89413e28f75edc4c08f16103d82a5db2fa812a6e650a8faaac0b419
7
+ data.tar.gz: c5509b0fc890c32b1f7b55e525933ba819afa90ba0fcfa3629eb5c597379d21b1455734b40a36b48b2f3a3c8344466c9ea5a980d21e29f21ebc1b1119d8f338a
@@ -0,0 +1,10 @@
1
+ require "omniauth-cohabitat-user/version"
2
+ require "omniauth"
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ autoload :CohabitatUser, 'omniauth/strategies/cohabitat-user'
7
+ end
8
+ end
9
+
10
+ OmniAuth.config.add_camelization 'cohabitat_user', 'CohabitatUser'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module CohabitatUser
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,27 @@
1
+ require 'omniauth/strategies/oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class CohabitatUser < OmniAuth::Strategies::OAuth2
6
+ option :name, 'cohabitat_user'
7
+
8
+ option :client_options, {
9
+ :site => "#{ENV["OMNIAUTH_COHABITAT_USER_BASE_URL"] || "https://konto.cohabitat.net"}",
10
+ :token_url => "#{ENV["OMNIAUTH_COHABITAT_USER_BASE_URL"] || "https://konto.cohabitat.net"}/oauth/token",
11
+ :authorize_url => "#{ENV["OMNIAUTH_COHABITAT_USER_BASE_URL"] || "https://konto.cohabitat.net"}/oauth/authorize/User",
12
+ }
13
+
14
+ uid { raw_info["id"] }
15
+
16
+ info do
17
+ {
18
+ email: raw_info["email"]
19
+ }
20
+ end
21
+
22
+ def raw_info
23
+ @raw_info ||= access_token.get('/oauth/user_info.json').parsed
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require "omniauth-cohabitat-user/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "omniauth-cohabitat-user"
7
+ s.version = OmniAuth::CohabitatUser::VERSION
8
+ s.authors = ["Marcin Lewandowski"]
9
+ s.email = ["marcin@saepia.net"]
10
+ s.homepage = "http://github.com/Cohabitat/omniauth-cohabitat-user"
11
+ s.summary = "Official OmniAuth strategy for users of Cohabitat apps"
12
+ s.description = "Official OmniAuth strategy for users of Cohabitat apps"
13
+
14
+ s.add_dependency 'omniauth', '~> 1.0'
15
+ s.add_dependency 'omniauth-oauth2', '~> 1.1'
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.require_paths = ['lib']
19
+ s.required_ruby_version = '>= 1.9.3'
20
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-cohabitat-user
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Marcin Lewandowski
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth-oauth2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ description: Official OmniAuth strategy for users of Cohabitat apps
42
+ email:
43
+ - marcin@saepia.net
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/omniauth-cohabitat-user.rb
49
+ - lib/omniauth-cohabitat-user/version.rb
50
+ - lib/omniauth/strategies/cohabitat-user.rb
51
+ - omniauth-cohabitat-user.gemspec
52
+ homepage: http://github.com/Cohabitat/omniauth-cohabitat-user
53
+ licenses: []
54
+ metadata: {}
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '>='
62
+ - !ruby/object:Gem::Version
63
+ version: 1.9.3
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ requirements: []
70
+ rubyforge_project:
71
+ rubygems_version: 2.0.14
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Official OmniAuth strategy for users of Cohabitat apps
75
+ test_files: []