omniauth-academiaedu 0.0.1
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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/lib/omniauth/strategies/academiaedu.rb +44 -0
- data/lib/omniauth-academiaedu/version.rb +5 -0
- data/lib/omniauth-academiaedu.rb +2 -0
- data/omniauth-academiaedu.gemspec +25 -0
- metadata +68 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'omniauth-oauth2'
|
|
2
|
+
|
|
3
|
+
module OmniAuth
|
|
4
|
+
module Strategies
|
|
5
|
+
class AcademiaEdu < OmniAuth::Strategies::OAuth2
|
|
6
|
+
|
|
7
|
+
option :client_options, {
|
|
8
|
+
:site => 'http://api.academia.edu',
|
|
9
|
+
:authorize_url => 'http://academia.edu/oauth/authorize'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
def request_phase
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
uid { raw_info['id'] }
|
|
17
|
+
|
|
18
|
+
info do
|
|
19
|
+
{
|
|
20
|
+
:name => raw_info['display_name'],
|
|
21
|
+
:email => raw_info['email'],
|
|
22
|
+
:urls => {
|
|
23
|
+
:profile => raw_info['url']
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
extra do
|
|
29
|
+
{ :raw_info => raw_info }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def raw_info
|
|
33
|
+
@raw_info ||= access_token.get('/v0/user.json').parsed
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def callback_phase
|
|
37
|
+
super
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
OmniAuth.config.add_camelization 'academiaedu', 'AcademiaEdu'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "omniauth-academiaedu/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = "omniauth-academiaedu"
|
|
7
|
+
s.version = Omniauth::Academiaedu::VERSION
|
|
8
|
+
s.authors = ["Ryan Lower"]
|
|
9
|
+
s.email = ["rpjlower@gmail.com"]
|
|
10
|
+
s.homepage = "http://academia.edu/"
|
|
11
|
+
s.summary = "Academia.edu strategy for OmniAuth"
|
|
12
|
+
|
|
13
|
+
s.rubyforge_project = "omniauth-academiaedu"
|
|
14
|
+
|
|
15
|
+
s.files = `git ls-files`.split("\n")
|
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
18
|
+
s.require_paths = ["lib"]
|
|
19
|
+
|
|
20
|
+
s.add_runtime_dependency 'omniauth-oauth2', '~> 1.0.0'
|
|
21
|
+
|
|
22
|
+
# specify any dependencies here; for example:
|
|
23
|
+
# s.add_development_dependency "rspec"
|
|
24
|
+
# s.add_runtime_dependency "rest-client"
|
|
25
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: omniauth-academiaedu
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Ryan Lower
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2012-07-02 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: omniauth-oauth2
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 1.0.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.0
|
|
30
|
+
description:
|
|
31
|
+
email:
|
|
32
|
+
- rpjlower@gmail.com
|
|
33
|
+
executables: []
|
|
34
|
+
extensions: []
|
|
35
|
+
extra_rdoc_files: []
|
|
36
|
+
files:
|
|
37
|
+
- .gitignore
|
|
38
|
+
- Gemfile
|
|
39
|
+
- Rakefile
|
|
40
|
+
- lib/omniauth-academiaedu.rb
|
|
41
|
+
- lib/omniauth-academiaedu/version.rb
|
|
42
|
+
- lib/omniauth/strategies/academiaedu.rb
|
|
43
|
+
- omniauth-academiaedu.gemspec
|
|
44
|
+
homepage: http://academia.edu/
|
|
45
|
+
licenses: []
|
|
46
|
+
post_install_message:
|
|
47
|
+
rdoc_options: []
|
|
48
|
+
require_paths:
|
|
49
|
+
- lib
|
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
|
+
none: false
|
|
52
|
+
requirements:
|
|
53
|
+
- - ! '>='
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '0'
|
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ! '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
requirements: []
|
|
63
|
+
rubyforge_project: omniauth-academiaedu
|
|
64
|
+
rubygems_version: 1.8.23
|
|
65
|
+
signing_key:
|
|
66
|
+
specification_version: 3
|
|
67
|
+
summary: Academia.edu strategy for OmniAuth
|
|
68
|
+
test_files: []
|