oa-globocom 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +2 -0
- data/README.md +84 -0
- data/Rakefile +7 -0
- data/lib/oa-globocom.rb +5 -0
- data/lib/oa-globocom/version.rb +9 -0
- data/lib/omni_auth/strategies/globocom.rb +65 -0
- data/oa-globocom.gemspec +24 -0
- data/spec/omni_auth/strategies/globocom_spec.rb +134 -0
- data/spec/spec_helper.rb +35 -0
- data/spec/support/fixtures/autorizacao.xml +13 -0
- data/spec/support/fixtures/autorizacao_fail.xml +13 -0
- data/spec/support/fixtures/config.yml +5 -0
- data/spec/support/fixtures/pessoa.xml +77 -0
- metadata +138 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.2@cadun
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Globo.com OmniAuth
|
2
|
+
|
3
|
+
The goal of this gem is to create a bridge between Globo.com's authentication and your app through OmniAuth.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add into your Gemfile
|
8
|
+
|
9
|
+
gem "oa-globocom"
|
10
|
+
|
11
|
+
## Configuration
|
12
|
+
|
13
|
+
The middleware has 2 important options: `:service_id` and `:config_file`.
|
14
|
+
:service_id is the number of your service at Globo.com.
|
15
|
+
:config_file is the YAML formatted file with the urls you want to use:
|
16
|
+
|
17
|
+
cadun:
|
18
|
+
logout_url: https://login.dev.globoi.com/Servlet/do/logout
|
19
|
+
login_url: https://login.dev.globoi.com/login
|
20
|
+
auth_url: isp-authenticator.dev.globoi.com
|
21
|
+
auth_port: 8280
|
22
|
+
|
23
|
+
The `config_file` must be in that format, otherwise it won't work. The final result will look like this:
|
24
|
+
|
25
|
+
config.middleware.use OmniAuth::Strategies::GloboCom, :service_id => 1234, :config_file => "#{File.dirname(__FILE__)}/cadun.yml"
|
26
|
+
|
27
|
+
After that, you just need to follow the OmniAuth standard configuration creating a callback controller to handle the CadUn's redirect. Something like this:
|
28
|
+
|
29
|
+
class SessionsController < ActionController::Base
|
30
|
+
def new
|
31
|
+
redirect_to logged_in? ? dashboard_url : '/auth/globocom'
|
32
|
+
end
|
33
|
+
|
34
|
+
def create
|
35
|
+
if auth = request.env['omniauth.auth']
|
36
|
+
user = begin
|
37
|
+
User.find(auth['uid'])
|
38
|
+
rescue ActiveRecord::RecordNotFound
|
39
|
+
User.create_from_omniauth(auth)
|
40
|
+
end
|
41
|
+
|
42
|
+
session[:user_id] = user.id
|
43
|
+
redirect_to root_url
|
44
|
+
else
|
45
|
+
redirect_to '/auth/cadun'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def destroy
|
50
|
+
session.delete(:user_id)
|
51
|
+
cookies.delete("GLBID")
|
52
|
+
redirect_to root_url
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
That way the controller will check if OmniAuth has returned the Globo.com's data, if so it will find or create an user, if not it will redirect the user back to the CadUn authentication screen.
|
57
|
+
|
58
|
+
And set your routes:
|
59
|
+
|
60
|
+
match "/auth/cadun" => "sessions#new"
|
61
|
+
match "/auth/cadun/callback" => "sessions#create"
|
62
|
+
match "/auth/cadun/logout" => "sessions#destroy"
|
63
|
+
|
64
|
+
|
65
|
+
## Tips: Dynamic Service Ids
|
66
|
+
|
67
|
+
Let's say your application works with many service ids. You can work with a "SETUP" step.
|
68
|
+
|
69
|
+
Add to the configuration:
|
70
|
+
|
71
|
+
config.middleware.use OmniAuth::Strategies::GloboCom, :service_id => 1234, :setup => true, :config => "cadun.yml"
|
72
|
+
|
73
|
+
Then add to your callback controller:
|
74
|
+
|
75
|
+
class SessionsController < ActionController::Base
|
76
|
+
def setup
|
77
|
+
request.env['omniauth.strategy'].options[:service_id] = object.service_id
|
78
|
+
render :nothing => true, :status => 404
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
It's really important to finish the action with a 404 status. It says to OmniAuth that it can go ahead and complete the flow.
|
83
|
+
|
84
|
+
The setup step can change the options of the Strategy, so you can change the service id and the redirect will go to any service you set up.
|
data/Rakefile
ADDED
data/lib/oa-globocom.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'cadun/config'
|
2
|
+
require 'cadun/user'
|
3
|
+
require 'cadun/gateway'
|
4
|
+
|
5
|
+
module OmniAuth
|
6
|
+
module Strategies
|
7
|
+
class GloboCom
|
8
|
+
include OmniAuth::Strategy
|
9
|
+
|
10
|
+
def initialize(app, options = {})
|
11
|
+
Cadun::Config.load_file(options[:config])
|
12
|
+
|
13
|
+
super(app, :globocom, options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def request_phase
|
17
|
+
redirect "#{Cadun::Config.login_url}/#{service_id}?url=#{callback_url}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def callback_phase
|
21
|
+
begin
|
22
|
+
super
|
23
|
+
rescue => e
|
24
|
+
fail!(:invalid_credentials, e)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def auth_hash
|
29
|
+
self.class.build_auth_hash(user, request)
|
30
|
+
end
|
31
|
+
|
32
|
+
def user
|
33
|
+
@user ||= Cadun::User.new(:glb_id => request.params['GLBID'], :ip => client_ip, :service_id => service_id)
|
34
|
+
end
|
35
|
+
|
36
|
+
def service_id
|
37
|
+
@options[:service_id]
|
38
|
+
end
|
39
|
+
|
40
|
+
def callback_url
|
41
|
+
uri = request.env['HTTP_HOST']
|
42
|
+
port = request.env['SERVER_PORT'] == "80" ? nil : ":#{request.env['SERVER_PORT']}"
|
43
|
+
scheme = request.env['rack.url_scheme']
|
44
|
+
|
45
|
+
callback_url = "#{scheme}://#{uri}#{port}/auth/#{name}/callback"
|
46
|
+
URI.escape(callback_url, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
|
47
|
+
end
|
48
|
+
|
49
|
+
def client_ip
|
50
|
+
if env['HTTP_X_FORWARDED_FOR'] and not env['HTTP_X_FORWARDED_FOR'].empty?
|
51
|
+
env['HTTP_X_FORWARDED_FOR'].split(',').last.strip
|
52
|
+
else
|
53
|
+
env['REMOTE_ADDR']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.build_auth_hash(user, request = nil)
|
58
|
+
hash = { :provider => "globocom", :uid => user.id, :user_info => user.to_hash.merge(:birthday => user.birthday.strftime('%d/%m/%Y')) }
|
59
|
+
hash[:user_info].merge!(:GLBID => request.params['GLBID'], :url => request.params['url']) if request
|
60
|
+
|
61
|
+
hash
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/oa-globocom.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require "#{File.dirname(__FILE__)}/lib/oa-globocom/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'oa-globocom'
|
6
|
+
s.version = OAGloboCom::VERSION::STRING
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = %w(Bruno Azisaka Maciel)
|
9
|
+
s.email = %w(bruno@azisaka.com.br)
|
10
|
+
s.homepage = 'https://github.com/azisaka/oa-globocom'
|
11
|
+
s.summary = 'OmniAuth strategy for Globo.com authentication system'
|
12
|
+
s.description = 'The goal of this gem is to allow the developer to use ContaGlobo.com (a login webservice made by Globo.com) in any web app using OmniAuth'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
16
|
+
s.require_paths = %w(lib)
|
17
|
+
|
18
|
+
s.add_dependency 'oa-core'
|
19
|
+
s.add_dependency 'cadun', '0.3.3'
|
20
|
+
s.add_development_dependency 'rack'
|
21
|
+
s.add_development_dependency 'rspec'
|
22
|
+
s.add_development_dependency 'rr'
|
23
|
+
s.add_development_dependency 'fakeweb'
|
24
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe OmniAuth::Strategies::GloboCom do
|
5
|
+
|
6
|
+
let(:app) { lambda { |env| [200, {}, ['Hello']] } }
|
7
|
+
let(:strategy) { OmniAuth::Strategies::GloboCom.new app, :service_id => 1, :config => "#{File.dirname(__FILE__)}/../../support/fixtures/config.yml" }
|
8
|
+
|
9
|
+
describe "#request_phase" do
|
10
|
+
context "when it has a referer" do
|
11
|
+
before do
|
12
|
+
strategy.call! Rack::MockRequest.env_for("http://test.localhost/auth/globocom", "rack.session" => {}, "HTTP_HOST" => "test.localhost")
|
13
|
+
|
14
|
+
@status, @headers, @body = strategy.request_phase
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "status" do
|
18
|
+
it { @status.should == 302 }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "headers" do
|
22
|
+
it { @headers.should include("Location" => "https://login.dev.globoi.com/login/1?url=http%3A%2F%2Ftest.localhost%2Fauth%2Fglobocom%2Fcallback") }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "when it has a referer and a different port" do
|
27
|
+
before do
|
28
|
+
strategy.call!(Rack::MockRequest.env_for("http://test.localhost:8080/auth/globocom", "rack.session" => {}, "HTTP_HOST" => "test.localhost", "SERVER_PORT" => "8080"))
|
29
|
+
|
30
|
+
@status, @headers, @body = strategy.request_phase
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "status" do
|
34
|
+
it { @status.should == 302 }
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "headers" do
|
38
|
+
it { @headers.should include("Location" => "https://login.dev.globoi.com/login/1?url=http%3A%2F%2Ftest.localhost%3A8080%2Fauth%2Fglobocom%2Fcallback") }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "#callback_phase" do
|
44
|
+
context "when the authorization fails" do
|
45
|
+
before do
|
46
|
+
stub_fail_requests
|
47
|
+
strategy.call! Rack::MockRequest.env_for("http://localhost/auth/globocom/callback?GLBID=GLBID", "rack.session" => {}, "REMOTE_ADDR" => "127.0.0.1")
|
48
|
+
end
|
49
|
+
|
50
|
+
it { strategy.env['omniauth.auth'].should be_nil }
|
51
|
+
it { strategy.env['omniauth.error'].message.should == "not authorized" }
|
52
|
+
it { strategy.env['omniauth.error.type'].should == :invalid_credentials }
|
53
|
+
end
|
54
|
+
|
55
|
+
context "when the authorization succeeds" do
|
56
|
+
before do
|
57
|
+
stub_requests
|
58
|
+
strategy.call! Rack::MockRequest.env_for("http://localhost/auth/globocom/callback?GLBID=GLBID", "rack.session" => {}, "REMOTE_ADDR" => "127.0.0.1")
|
59
|
+
end
|
60
|
+
|
61
|
+
it { strategy.env['omniauth.auth'].should_not be_nil }
|
62
|
+
it { strategy.env['omniauth.error'].should be_nil }
|
63
|
+
it { strategy.env['omniauth.error.type'].should be_nil }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "#auth_hash" do
|
68
|
+
before do
|
69
|
+
stub_requests
|
70
|
+
strategy.call! Rack::MockRequest.env_for("http://localhost?GLBID=GLBID&url=/go_back", "rack.session" => {}, "REMOTE_ADDR" => "127.0.0.1")
|
71
|
+
end
|
72
|
+
|
73
|
+
describe ":uid" do
|
74
|
+
it { strategy.auth_hash[:uid].should == "21737810" }
|
75
|
+
end
|
76
|
+
|
77
|
+
describe ":provider" do
|
78
|
+
it { strategy.auth_hash[:provider].should == "globocom" }
|
79
|
+
end
|
80
|
+
|
81
|
+
describe ":user_info" do
|
82
|
+
subject { strategy.auth_hash[:user_info] }
|
83
|
+
|
84
|
+
it { should include(:address => "Rua Uruguai, 59") }
|
85
|
+
it { should include(:birthday => "22/02/1983") }
|
86
|
+
it { should include(:city => "Rio de Janeiro") }
|
87
|
+
it { should include(:country => "Brasil") }
|
88
|
+
it { should include(:cpf => "09532034765") }
|
89
|
+
it { should include(:email => "fab1@spam.la") }
|
90
|
+
it { should include(:gender => "MASCULINO") }
|
91
|
+
it { should include(:GLBID => "GLBID") }
|
92
|
+
it { should include(:cadun_id => "21737810") }
|
93
|
+
it { should include(:mobile => "21 99999999") }
|
94
|
+
it { should include(:name => "Fabricio Rodrigo Lopes") }
|
95
|
+
it { should include(:neighborhood => "Andaraí") }
|
96
|
+
it { should include(:login => "fabricio_fab1") }
|
97
|
+
it { should include(:phone => "21 22881060") }
|
98
|
+
it { should include(:state => "RJ") }
|
99
|
+
it { should include(:status => "ATIVO") }
|
100
|
+
it { should include(:url => "/go_back") }
|
101
|
+
it { should include(:user_type => "NAO_ASSINANTE") }
|
102
|
+
it { should include(:zipcode => "20510060") }
|
103
|
+
it { should include(:complement => "807") }
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
describe "#client_ip" do
|
108
|
+
it 'should return ip from REMOTE_ADDR when it comes alone' do
|
109
|
+
strategy.call! Rack::MockRequest.env_for("http://test.localhost/auth/globocom", "rack.session" => {}, 'REMOTE_ADDR' => '200.201.0.15')
|
110
|
+
strategy.client_ip.should == '200.201.0.15'
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'should return ip from REMOTE_ADDR when HTTP_X_FORWARDED_FOR is empty' do
|
114
|
+
strategy.call! Rack::MockRequest.env_for("http://test.localhost/auth/globocom", "rack.session" => {}, 'REMOTE_ADDR' => '200.201.0.20', 'HTTP_X_FORWARDED_FOR' => '')
|
115
|
+
strategy.client_ip.should == '200.201.0.20'
|
116
|
+
end
|
117
|
+
|
118
|
+
it 'should return ip from HTTP_X_FORWARDED_FOR when it comes alone' do
|
119
|
+
strategy.call! Rack::MockRequest.env_for("http://test.localhost/auth/globocom", "rack.session" => {}, 'HTTP_X_FORWARDED_FOR' => '201.10.0.15')
|
120
|
+
strategy.client_ip.should == '201.10.0.15'
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'should return ip from HTTP_X_FORWARDED_FOR even if REMOTE_ADDR is present' do
|
124
|
+
strategy.call! Rack::MockRequest.env_for("http://test.localhost/auth/globocom", "rack.session" => {}, 'REMOTE_ADDR' => '200.201.0.15', 'HTTP_X_FORWARDED_FOR' => '201.10.0.16')
|
125
|
+
strategy.client_ip.should == '201.10.0.16'
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'should always return the last ip from HTTP_X_FORWARDED_FOR' do
|
129
|
+
strategy.call! Rack::MockRequest.env_for("http://test.localhost/auth/globocom", "rack.session" => {}, 'HTTP_X_FORWARDED_FOR' => '201.10.0.15, 201.10.0.16, 201.10.0.17')
|
130
|
+
strategy.client_ip.should == '201.10.0.17'
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require "#{File.dirname(__FILE__)}/../lib/oa-globocom"
|
2
|
+
require 'fakeweb'
|
3
|
+
require 'rack/mock'
|
4
|
+
|
5
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.before :suite do
|
9
|
+
FakeWeb.allow_net_connect = false
|
10
|
+
end
|
11
|
+
|
12
|
+
config.before :each do
|
13
|
+
FakeWeb.clean_registry
|
14
|
+
end
|
15
|
+
|
16
|
+
config.mock_with :rr
|
17
|
+
config.filter_run :focus => true
|
18
|
+
config.run_all_when_everything_filtered = true
|
19
|
+
end
|
20
|
+
|
21
|
+
def stub_requests
|
22
|
+
FakeWeb.register_uri :put, "http://isp-authenticator.dev.globoi.com:8280/ws/rest/autorizacao",
|
23
|
+
:body => File.join(File.dirname(__FILE__), "support", "fixtures", "autorizacao.xml")
|
24
|
+
|
25
|
+
FakeWeb.register_uri :get, "http://isp-authenticator.dev.globoi.com:8280/cadunii/ws/resources/pessoa/21737810",
|
26
|
+
:body => File.join(File.dirname(__FILE__), "support", "fixtures", "pessoa.xml")
|
27
|
+
end
|
28
|
+
|
29
|
+
def stub_fail_requests
|
30
|
+
FakeWeb.register_uri :put, "http://isp-authenticator.dev.globoi.com:8280/ws/rest/autorizacao",
|
31
|
+
:body => File.join(File.dirname(__FILE__), "support", "fixtures", "autorizacao_fail.xml")
|
32
|
+
|
33
|
+
FakeWeb.register_uri :get, "http://isp-authenticator.dev.globoi.com:8280/cadunii/ws/resources/pessoa/21737810",
|
34
|
+
:body => File.join(File.dirname(__FILE__), "support", "fixtures", "pessoa.xml")
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2
|
+
<usuarioAutorizado>
|
3
|
+
<emailPrincipal>fab1@spam.la</emailPrincipal>
|
4
|
+
<glbId>1484e00106ea401d57902541631200e8a6d44556132366c754c4261655666625537614531655252536e6262626c63676676436c6c316744544d5636617651707a6d417a49756b6e3830415a4a394f36773a303a66616231407370616d2e6c61</glbId>
|
5
|
+
<ip>10.2.25.160</ip>
|
6
|
+
<login>fab1@spam.la</login>
|
7
|
+
<servicoID>2626</servicoID>
|
8
|
+
<status>AUTORIZADO</status>
|
9
|
+
<statusUsuario>ATIVO</statusUsuario>
|
10
|
+
<tipoUsuario>NAO_ASSINANTE</tipoUsuario>
|
11
|
+
<username>fabricio_fab1</username>
|
12
|
+
<usuarioID>21737810</usuarioID>
|
13
|
+
</usuarioAutorizado>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2
|
+
<usuarioAutorizado>
|
3
|
+
<emailPrincipal>fab1@spam.la</emailPrincipal>
|
4
|
+
<glbId>1484e00106ea401d57902541631200e8a6d44556132366c754c4261655666625537614531655252536e6262626c63676676436c6c316744544d5636617651707a6d417a49756b6e3830415a4a394f36773a303a66616231407370616d2e6c61</glbId>
|
5
|
+
<ip>10.2.25.160</ip>
|
6
|
+
<login>fab1@spam.la</login>
|
7
|
+
<servicoID>2626</servicoID>
|
8
|
+
<status>NAO_AUTORIZADO</status>
|
9
|
+
<statusUsuario>ATIVO</statusUsuario>
|
10
|
+
<tipoUsuario>NAO_ASSINANTE</tipoUsuario>
|
11
|
+
<username>fabricio_fab1</username>
|
12
|
+
<usuarioID>21737810</usuarioID>
|
13
|
+
</usuarioAutorizado>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2
|
+
<pessoa>
|
3
|
+
<id>21737810</id>
|
4
|
+
<alteracao>2011-04-25T00:00:00-03:00</alteracao>
|
5
|
+
<bairro>Andaraí</bairro>
|
6
|
+
<cep>20510060</cep>
|
7
|
+
<cidade>
|
8
|
+
<estadoId>19</estadoId>
|
9
|
+
<id>7043</id>
|
10
|
+
<nome>Rio de Janeiro</nome>
|
11
|
+
</cidade>
|
12
|
+
<cidadeId>7043</cidadeId>
|
13
|
+
<complemento>807</complemento>
|
14
|
+
<cookie>0000097QgXvo9pYpqTFi1p21BBPvV0Al</cookie>
|
15
|
+
<cpf>09532034765</cpf>
|
16
|
+
<criacao>2009-05-08T00:00:00-03:00</criacao>
|
17
|
+
<dataNascimento>1983-02-22T00:00:00-03:00</dataNascimento>
|
18
|
+
<emailPrincipal>fab1@spam.la</emailPrincipal>
|
19
|
+
<endereco>Rua Uruguai</endereco>
|
20
|
+
<estado>
|
21
|
+
<id>19</id>
|
22
|
+
<nome>Rio de Janeiro</nome>
|
23
|
+
<paisId>1</paisId>
|
24
|
+
<sigla>RJ</sigla>
|
25
|
+
</estado>
|
26
|
+
<estadoId>19</estadoId>
|
27
|
+
<ipCadastro>127.0.0.1</ipCadastro>
|
28
|
+
<login>fabricio_fab1</login>
|
29
|
+
<modulos>
|
30
|
+
<criacao>2009-05-08T10:04:35-03:00</criacao>
|
31
|
+
<moduloID>2</moduloID>
|
32
|
+
<pessoaID>21737810</pessoaID>
|
33
|
+
</modulos>
|
34
|
+
<modulos>
|
35
|
+
<alteracao>2011-04-14T18:04:15-03:00</alteracao>
|
36
|
+
<criacao>2009-05-08T10:04:35-03:00</criacao>
|
37
|
+
<moduloID>1</moduloID>
|
38
|
+
<pessoaID>21737810</pessoaID>
|
39
|
+
</modulos>
|
40
|
+
<modulos>
|
41
|
+
<criacao>2009-05-08T10:04:35-03:00</criacao>
|
42
|
+
<moduloID>3</moduloID>
|
43
|
+
<pessoaID>21737810</pessoaID>
|
44
|
+
</modulos>
|
45
|
+
<modulos>
|
46
|
+
<criacao>2009-05-08T10:04:35-03:00</criacao>
|
47
|
+
<moduloID>4</moduloID>
|
48
|
+
<pessoaID>21737810</pessoaID>
|
49
|
+
</modulos>
|
50
|
+
<modulos>
|
51
|
+
<criacao>2009-05-08T10:04:35-03:00</criacao>
|
52
|
+
<moduloID>7</moduloID>
|
53
|
+
<pessoaID>21737810</pessoaID>
|
54
|
+
</modulos>
|
55
|
+
<nome>Fabricio Rodrigo Lopes</nome>
|
56
|
+
<numero>59</numero>
|
57
|
+
<optinCelular>false</optinCelular>
|
58
|
+
<optinGlobo>true</optinGlobo>
|
59
|
+
<optinParceiros>true</optinParceiros>
|
60
|
+
<origemId>181</origemId>
|
61
|
+
<pais>
|
62
|
+
<id>1</id>
|
63
|
+
<nome>Brasil</nome>
|
64
|
+
<sigla>BR</sigla>
|
65
|
+
</pais>
|
66
|
+
<paisId>1</paisId>
|
67
|
+
<perguntaId>3</perguntaId>
|
68
|
+
<resposta>preto</resposta>
|
69
|
+
<servicoOrigemId>807</servicoOrigemId>
|
70
|
+
<sexo>MASCULINO</sexo>
|
71
|
+
<status>ATIVO</status>
|
72
|
+
<telefoneCelular>99999999</telefoneCelular>
|
73
|
+
<telefoneCelularDdd>21</telefoneCelularDdd>
|
74
|
+
<telefoneResidencial>22881060</telefoneResidencial>
|
75
|
+
<telefoneResidencialDdd>21</telefoneResidencialDdd>
|
76
|
+
<tipoUsuario>NAO_ASSINANTE</tipoUsuario>
|
77
|
+
</pessoa>
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: oa-globocom
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Bruno
|
9
|
+
- Azisaka
|
10
|
+
- Maciel
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
|
15
|
+
date: 2011-06-08 00:00:00 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: oa-core
|
19
|
+
prerelease: false
|
20
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: "0"
|
26
|
+
type: :runtime
|
27
|
+
version_requirements: *id001
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: cadun
|
30
|
+
prerelease: false
|
31
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
33
|
+
requirements:
|
34
|
+
- - "="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.3.3
|
37
|
+
type: :runtime
|
38
|
+
version_requirements: *id002
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: rack
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id003
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rspec
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
type: :development
|
60
|
+
version_requirements: *id004
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rr
|
63
|
+
prerelease: false
|
64
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
type: :development
|
71
|
+
version_requirements: *id005
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: fakeweb
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: "0"
|
81
|
+
type: :development
|
82
|
+
version_requirements: *id006
|
83
|
+
description: The goal of this gem is to allow the developer to use ContaGlobo.com (a login webservice made by Globo.com) in any web app using OmniAuth
|
84
|
+
email:
|
85
|
+
- bruno@azisaka.com.br
|
86
|
+
executables: []
|
87
|
+
|
88
|
+
extensions: []
|
89
|
+
|
90
|
+
extra_rdoc_files: []
|
91
|
+
|
92
|
+
files:
|
93
|
+
- .gitignore
|
94
|
+
- .rspec
|
95
|
+
- .rvmrc
|
96
|
+
- .travis.yml
|
97
|
+
- Gemfile
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- lib/oa-globocom.rb
|
101
|
+
- lib/oa-globocom/version.rb
|
102
|
+
- lib/omni_auth/strategies/globocom.rb
|
103
|
+
- oa-globocom.gemspec
|
104
|
+
- spec/omni_auth/strategies/globocom_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- spec/support/fixtures/autorizacao.xml
|
107
|
+
- spec/support/fixtures/autorizacao_fail.xml
|
108
|
+
- spec/support/fixtures/config.yml
|
109
|
+
- spec/support/fixtures/pessoa.xml
|
110
|
+
homepage: https://github.com/azisaka/oa-globocom
|
111
|
+
licenses: []
|
112
|
+
|
113
|
+
post_install_message:
|
114
|
+
rdoc_options: []
|
115
|
+
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: "0"
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: "0"
|
130
|
+
requirements: []
|
131
|
+
|
132
|
+
rubyforge_project:
|
133
|
+
rubygems_version: 1.8.4
|
134
|
+
signing_key:
|
135
|
+
specification_version: 3
|
136
|
+
summary: OmniAuth strategy for Globo.com authentication system
|
137
|
+
test_files: []
|
138
|
+
|