omniauth-istherea 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Istherea < OmniAuth::Strategies::OAuth2
6
+ # Give your strategy a name.
7
+ option :name, "istherea"
8
+
9
+ # This is where you pass the options you would pass when
10
+ # initializing your consumer from the OAuth gem.
11
+ option :client_options, {:site => "http://istherea.herokuapp.com"} # {:site => "http://localhost:3000"}
12
+
13
+ # These are called after authentication has succeeded. If
14
+ # possible, you should try to set the UID without making
15
+ # additional calls (if the user id is returned with the token
16
+ # or as a URI parameter). This may not be possible with all
17
+ # providers.
18
+ uid { raw_info['id'] }
19
+
20
+ info do
21
+ {
22
+ :name => raw_info['name'],
23
+ :email => raw_info['email'],
24
+ :first_name => raw_info['first_name'],
25
+ :last_name => raw_info['last_name']
26
+ }
27
+ end
28
+
29
+ extra do
30
+ {
31
+ 'raw_info' => raw_info
32
+ }
33
+ end
34
+
35
+ def raw_info
36
+ # Istherea returns a json structure for the 'current_user' when the '/me' URL is requested
37
+ @raw_info ||= access_token.get('/me').parsed || {}
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1 @@
1
+ require 'omniauth/strategies/istherea.rb'
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-istherea
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ethan Stryker
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-22 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: ! ' An OAuth2 based strategy for Istherea
15
+
16
+ '
17
+ email: e.stryker@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/omniauth-istherea.rb
23
+ - lib/omniauth/strategies/istherea.rb
24
+ homepage: https://github.com/estryker/omniauth-istherea
25
+ licenses: []
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubyforge_project:
44
+ rubygems_version: 1.8.6
45
+ signing_key:
46
+ specification_version: 3
47
+ summary: An OAuth2 based strategy for Istherea
48
+ test_files: []