omniauth-cloudron 0.3.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: 29d9b4a0168b02b6c4fae66cd453d828b67f19ba
4
+ data.tar.gz: 81cd3bf8bd215b88100c54048fa6b5e7ed1a9794
5
+ SHA512:
6
+ metadata.gz: 32ef9024affd94f6a1a468ffeba5a7422bd58aac99e053ebb99f7bf58327a02aaf98c51d5a7063006194826820d0cb725f08f087d703343e3d55e92fdbba17d1
7
+ data.tar.gz: 9b4df31067d6994fed503fed354cb0a05a8dbb3fbaa626994bbe2cdf1a09ca1767959c9965da2732a26bb9025402e454a1e4708336ab43e3d43c29ee4c950072
@@ -0,0 +1,2 @@
1
+ require "omniauth-cloudron/version"
2
+ require 'omniauth/strategies/cloudron'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Cloudron
3
+ VERSION = "0.3.0"
4
+ end
5
+ end
@@ -0,0 +1,54 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ require 'openssl'
4
+
5
+ OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
6
+
7
+ module OmniAuth
8
+ module Strategies
9
+ class Cloudron < OmniAuth::Strategies::OAuth2
10
+ # Give your strategy a name.
11
+ option :name, "cloudron"
12
+
13
+ # This is where you pass the options you would pass when
14
+ # initializing your consumer from the OAuth gem.
15
+ option :client_options, {
16
+ :site => ENV['API_ORIGIN'],
17
+ :authorize_url => "#{ENV['API_ORIGIN']}/api/v1/oauth/dialog/authorize",
18
+ :token_url => "#{ENV['API_ORIGIN']}/api/v1/oauth/token"
19
+ }
20
+ option :client_id, ENV['OAUTH_CLIENT_ID']
21
+ option :client_secret, ENV['OAUTH_CLIENT_SECRET']
22
+ option :provider_ignores_state, true
23
+
24
+ # These are called after authentication has succeeded. If
25
+ # possible, you should try to set the UID without making
26
+ # additional calls (if the user id is returned with the token
27
+ # or as a URI parameter). This may not be possible with all
28
+ # providers.
29
+ uid{ raw_info['id'] }
30
+
31
+ info do
32
+ {
33
+ :name => raw_info['username'],
34
+ :email => raw_info['email']
35
+ }
36
+ end
37
+
38
+ extra do
39
+ {
40
+ 'raw_info' => raw_info
41
+ }
42
+ end
43
+
44
+ def raw_info
45
+ # @raw_info ||= access_token.get('/api/v1/profile').parsed
46
+ info = access_token.get('/api/v1/profile').parsed
47
+ puts info
48
+ return info
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ OmniAuth.config.add_camelization 'cloudron', 'Cloudron'
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-cloudron
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Johannes Zellner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Cloudron omniauth provider
14
+ email: johannes@cloudron.io
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/omniauth-cloudron.rb
20
+ - lib/omniauth-cloudron/version.rb
21
+ - lib/omniauth/strategies/cloudron.rb
22
+ homepage: http://cloudron.io
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.4.5
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Cloudron omniauth provider
46
+ test_files: []
47
+ has_rdoc: