openid
Marcin Kulik 10 years ago
parent 933c5d9801
commit 83f0a20e95

@ -13,6 +13,7 @@ gem 'omniauth', '~> 1.1.4'
gem 'omniauth-twitter', '~> 0.0.16'
gem 'omniauth-github', '~> 1.1.0'
gem 'omniauth-browserid', git: 'https://github.com/callahad/omniauth-browserid.git'
gem 'omniauth-openid', '~> 1.0.1'
gem 'kaminari', '~> 0.14.1'
gem 'airbrake', '~> 3.1.14'
gem 'draper', '~> 1.2.1'

@ -193,6 +193,9 @@ GEM
omniauth-oauth2 (1.1.1)
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
omniauth-openid (1.0.1)
omniauth (~> 1.0)
rack-openid (~> 1.3.1)
omniauth-twitter (0.0.18)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
@ -214,6 +217,9 @@ GEM
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
rack (1.5.2)
rack-openid (1.3.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-protection (1.5.0)
rack
rack-test (0.6.2)
@ -261,6 +267,7 @@ GEM
rspec-mocks (= 3.0.0.beta1)
rspec-support (3.0.0.beta1)
ruby-hmac (0.4.0)
ruby-openid (2.5.0)
sass (3.2.12)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
@ -368,6 +375,7 @@ DEPENDENCIES
omniauth (~> 1.1.4)
omniauth-browserid!
omniauth-github (~> 1.1.0)
omniauth-openid (~> 1.0.1)
omniauth-twitter (~> 0.0.16)
open4 (~> 1.3.0)
pg (~> 0.14)

@ -1,8 +1,18 @@
.container
.row
.col-md-12
.col-md-6
h1 Sign in
p Sign in using your email address by clicking on the button below:
= link_to image_tag('email_sign_in_black.png', :title => "Sign in with your email"), '#', :id => 'persona-button'
.col-md-6
h1 Sign in
p Sign in with OpenID
form method="get" action="/auth/open_id"
input type="text" name="openid_url"
input type="submit"
/* = link_to 'Click', open_id_auth_path */

@ -1,3 +1,5 @@
require 'openid/store/filesystem'
Asciinema::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@ -27,3 +29,5 @@ Asciinema::Application.configure do
# number of complex assets.
config.assets.debug = true
end
::Asciinema::OpenIDStore = OpenID::Store::Filesystem.new(File.join(Rails.root,'tmp'))

@ -1,3 +1,5 @@
require 'openid/store/memcache'
Asciinema::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@ -78,3 +80,5 @@ Asciinema::Application.configure do
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
end
::Asciinema::OpenIDStore = OpenID::Store::Memcache.new

@ -1,3 +1,5 @@
require 'openid/store/memory'
Asciinema::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
@ -34,3 +36,5 @@ Asciinema::Application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
end
::Asciinema::OpenIDStore = OpenID::Store::Memory.new

@ -1,7 +1,8 @@
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, CFG.twitter_consumer_key, CFG.twitter_consumer_secret, :client_options => { :ssl => { :ca_path => "/etc/ssl/certs" } }
provider :github, CFG.github_consumer_key, CFG.github_consumer_secret, :client_options => { :ssl => { :ca_path => "/etc/ssl/certs" } }
provider :twitter, CFG.twitter_consumer_key, CFG.twitter_consumer_secret, client_options: { ssl: { ca_path: "/etc/ssl/certs" } }
provider :github, CFG.github_consumer_key, CFG.github_consumer_secret, client_options: { ssl: { ca_path: "/etc/ssl/certs" } }
provider :browser_id
provider :open_id, store: Asciinema::OpenIDStore
end
OmniAuth.config.on_failure = Proc.new { |env|

@ -17,6 +17,7 @@ Asciinema::Application.routes.draw do
get "/docs/:page" => "docs#show", :as => :docs
get "/auth/browser_id/callback" => "sessions#create"
post "/auth/open_id/callback" => "sessions#create" #, as: :open_id_auth
get "/auth/:provider/callback" => "account_merges#create"
get "/auth/failure" => "sessions#failure"
@ -35,4 +36,5 @@ Asciinema::Application.routes.draw do
get '/privacy' => 'pages#show', page: :privacy, as: :privacy
get '/tos' => 'pages#show', page: :tos, as: :tos
get '/contributing' => 'pages#show', page: :contributing, as: :contributing
end

Loading…
Cancel
Save