devise_saml_authenticatable 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/devise/saml_sessions_controller.rb +3 -4
- data/devise_saml_authenticatable.gemspec +1 -1
- data/lib/devise_saml_authenticatable/routes.rb +1 -1
- data/lib/devise_saml_authenticatable/saml_config.rb +2 -2
- data/lib/devise_saml_authenticatable/strategy.rb +1 -1
- data/lib/devise_saml_authenticatable/version.rb +1 -1
- metadata +6 -6
@@ -2,17 +2,16 @@ require "ruby-saml"
|
|
2
2
|
|
3
3
|
class Devise::SamlSessionsController < Devise::SessionsController
|
4
4
|
include DeviseSamlAuthenticatable::SamlConfig
|
5
|
-
unloadable
|
5
|
+
unloadable if Rails::VERSION::MAJOR < 4
|
6
6
|
before_filter :get_saml_config
|
7
7
|
def new
|
8
|
-
|
9
|
-
request = Onelogin::Saml::Authrequest.new
|
8
|
+
request = OneLogin::RubySaml::Authrequest.new
|
10
9
|
action = request.create(@saml_config)
|
11
10
|
redirect_to action
|
12
11
|
end
|
13
12
|
|
14
13
|
def metadata
|
15
|
-
meta =
|
14
|
+
meta = OneLogin::RubySaml::Metadata.new
|
16
15
|
render :xml => meta.generate(@saml_config)
|
17
16
|
end
|
18
17
|
|
@@ -4,7 +4,7 @@ ActionDispatch::Routing::Mapper.class_eval do
|
|
4
4
|
resource :session, :only => [], :controller => controllers[:saml_sessions], :path => "" do
|
5
5
|
get :new, :path => "saml/sign_in", :as => "new"
|
6
6
|
post :create, :path=>"saml/auth"
|
7
|
-
match :destroy, :path => mapping.path_names[:sign_out], :as => "destroy"
|
7
|
+
match :destroy, :path => mapping.path_names[:sign_out], :as => "destroy", :via => mapping.sign_out_via
|
8
8
|
get :metadata, :path=>"saml/metadata"
|
9
9
|
end
|
10
10
|
end
|
@@ -2,7 +2,7 @@ require 'ruby-saml'
|
|
2
2
|
module DeviseSamlAuthenticatable
|
3
3
|
module SamlConfig
|
4
4
|
def get_saml_config
|
5
|
-
@saml_config =
|
5
|
+
@saml_config = OneLogin::RubySaml::Settings.new(YAML.load(File.read("#{Rails.root}/config/idp.yml"))[Rails.env])
|
6
6
|
end
|
7
7
|
end
|
8
|
-
end
|
8
|
+
end
|
@@ -7,7 +7,7 @@ module Devise
|
|
7
7
|
params[:SAMLResponse]
|
8
8
|
end
|
9
9
|
def authenticate!
|
10
|
-
@response =
|
10
|
+
@response = OneLogin::RubySaml::Response.new(params[:SAMLResponse])
|
11
11
|
@response.settings = get_saml_config
|
12
12
|
resource = mapping.to.authenticate_with_saml(@response.attributes)
|
13
13
|
if @response.is_valid?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_saml_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -32,17 +32,17 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- - ! '
|
35
|
+
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.
|
37
|
+
version: 0.8.2
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- - ! '
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
45
|
+
version: 0.8.2
|
46
46
|
description: SAML Authentication for devise
|
47
47
|
email:
|
48
48
|
- Josef.Sauter@gmail.com
|